Hi there,
Im pretty new to ASP.NET MVC, trying to figure out my way around.
Currently i return a ViewModel which has a IEnumeable Events as its only property. This ViewModel is StronglyTyped to a UserControl which dislays the IEnumable Events in tabular form.
One of the properties of the Event Model is an XElement, which contains some...
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ProductViewModel>" %>
<%= Html.DisplayFor(m => m.Product.Name) %>
Does not work. It says: "The type arguments for method ... cannot be inferred from the usage. Try specifying the type arguments explicitly."
...
I have two roles being used on my site currently, author & admin. Authors cannot access user administration functions. However, they should be able to edit certain parts of their profile. An admin is currently able to edit all parts of a user's profile. For example:
employee ID [admin]
display name [author,admin]
roles [admin...
I have a Regular Expression Validation for a Single Capital Letter, but it does not work.
When I put in a valid letter, I get the error message;
[DisplayName("Contract Letter")]
[RegularExpression("[A-Z]", ErrorMessage = "Must be a letter")]
[Required(ErrorMessage = "A Letter is required")]
public string ...
I am new to ASP.NET MVC 2 and would like to know what the easiest and/or best practice is to send "grid data" from a View to a Controller. Think of this "grid data" as an excel spreadsheet where some columns will have some data and some rows will have some data. In the controller I need to know not only what column and row contains dat...
If I have a route like this:
routes.Add(new Route("{controller}/{page}",
new RouteValueDictionary
{
{ "page", UrlParameter.Optional }
},
new RouteValueDictionary
{
{ "page", @"[Pp]age\d+" }
},
new MvcRouteHandler()
));
Then the route doesn't match when {page} is missing, however if I remov...
Hi,
I'm having this strange routing problem - I have 2 kinds of routes to the same view. Such as Simulator/RunStrategy/7 and Simulator/RunStrategy/7/1000.
Where as the controller and view is defined as public ActionResult RunStrategy(int id, decimal sum).
When I use the short one I see the view as needed, when i use the long one - I g...
When I debug my asp.net mvc 2 application and I put a break point on my action that is called when a 404 error occurs every time I invoke any action my error action gets called but the view does not get displayed.
This is in my web.config (copied from nerddinner):
<customErrors mode="RemoteOnly" defaultRedirect="/Home/Trouble">
<err...
I have a asp.net mvc 2 on .net 4 with code first entity framework data access.
When I deploy to one server it works beautifully, no prizes for guessing it doesnt work on the other...the message however I cannot understand
Attempt by method 'System.Data.Entity.ModelConfiguration.Internal.Configuration.CodeFirstCachedMetadataWorkspace.G...
In my project I have several classes with properties that should be unique, and I want to write a custom attribute that can be used on all the properties. For example I have class User with property username and class Application with property name that should be unique and I want to be able to do this:
[Unique(ErrorMessage = "Username...
I'm using jQuery in my ASP.NET MVC 2 page. It's a super simple post that gets a date in return. The process itself runs very quickly. I want to use a spinner image to show the user something is going on. All works fine in Firefox, testing locally. However, in IE 8, the spinner image doesn't display long enough; it just flickers. Th...
How do I deploy SQL CE 4.0 with EF4 to a shared hosting provider for ASP.NET MVC 2.0?
I've included System.Data.SqlServerCe.dll, and the amd64 + x86 directories in my bin folder, but keep getting a ".net provider not found". I realize it's currently in CTP, but this is just for testing purposes. My project + host is configured for .net ...
Hi, i'm using asp.net mvc 2 and Simplemodal with iframe
it works great but my controller is being called twice when opening in iframe
when i call the page directly, the controller is called only once
$.modal('<iframe id="frmDetails" src="' + src + '" >', { containerCss: { height: "90%", width: "90%"} });
is there an option that i'm ...
Platform: Windows 7 Ultimate
IDE: Visual Studio 2010 Ultimate
Web Environment: ASP.NET MVC 2
Database: SQL Server 2008 R2 Express
Data Access: Entity Framework 4
Form Validation: DataAnnotations
Sample App: NerdDinner from Wrox Pro ASP.NET MVC 2
Book: Wrox Professional MVC 2
Problem with Chapter 1 - Section: "Integrating Validation and B...
Hi,
I'm new to MVC and the new paradigm hasn't clicked yet. I want to create a user control that is a simple dropdown and uses data from a database to populate its items. The dropdown would be useable in any view I chose. At this point I don't need the control to be data/table agnostic, I'd settle for making the user control strongly ty...
I have two buttons on a single form. One is used to submit the form while the other is used to search. I do not want the search button to trigger any server side or client side validation.
How can I do this?
Thanks.
Edit
I'm using Data Annotations on the server to validate, example:
[Required(ErrorMessage = "Institution is req...
I'd like to wrap a span with an action link because I'm adhering to an existing CSS theme. It doesn't look like any of Html.ActionLink's constructors allow for this. Possible solutions:
A way to achieve this with existing helper?
Derive & override ActionLink with new custom html helper?
If #2 is the only way I have two questions.
...
Hello,
I have got this working with a local data source but not remotely. It uses the Jquery library and I have followed the instructions on the Jquery UI site. This is the code I have (which does not work). Can anyone a) amend this code to work b) show code of a working example?? Thanks:
JQUERY
$('#countries').autocomplete({
...
I have a simple form based off a model called Visitor. I'd like to have a search button by one of the id text fields so the user can click the button and have the page populate with visitor information: first name, last name, etc. In Web Forms I would do something like this:
page_load(){
person = businessManager.FindPersonById(Con...
I'm using ASP.Net MVC2. I would like to know if there is there a formula to calculate recurrence date? So from my client side I'm selecting dates and using ajax.post to send to the controller. My expecting result would be like so for example:
maxdate is September 30th
currentdate is today
duration is 3 days for every week
so output wo...