I'm using DataAnnotations attributes to validate my model objects. My model class looks similar to this:
public class MyModel
{
[Required]
public string Title { get; set; }
[Required(ErrorMessage = "At least one editor is required.")]
public List<User> Editors { get; set; }
}
public class User
{
public int Id { get...
I have problems deploying MVC2 application to my hosting. It shows the following error:
Could not load type 'System.Web.Mvc.UrlParameter' from assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
It looks like it does not understand the new "optional URL parameters" feature of MVC2.
This is just...
I want to know how, from a controller action, I could identify the area in which the controller is in via the MVC framework (I mean, without making all controllers in a given area inherit from a base controller with that info).
I'm particularly interested in the case of child actions (controller actions rendered via RenderAction), the ...
I want as well as Client Side Validation as Server Side Validation. I realized this as the following:
Model: ( The model has a DataModel(dbml) which contains the Test class )
namespace MyProject.TestProject
{
[MetadataType(typeof(TestMetaData))]
public partial class Test
{
}
public class TestMetaData
{
...
I'm running Visual Studio 2008 sp1 on Win7, with MVC2 RTM installed.
I created a new MVC2 project using the wizard and am unable to debug specific pages. With webforms and even MVC1, I was able to sit on a View page, hit F5, and then have the integrated web server in VS2008 start on the page I was working on. Very handy for building u...
I followed the http://haacked.com/archive/2010/04/15/sending-json-to-an-asp-net-mvc-action-method-argument.aspx blog on how to setup binding json data to a ViewModel. seems to work.
The problem is that it is super slow. A collection with 200 entries in it and 8 fields per entry takes 3 minutes to even reach a break point at the beginni...
I have read the following:
http://weblogs.asp.net/imranbaloch/archive/2010/08/23/asp-net-mvc-jquery-validation-and-validationsummary.aspx
http://haacked.com/archive/2009/11/19/aspnetmvc2-custom-validation.aspx
And still can't get the jQuery validation to work with MVC2. I can get non jQuery working but when i swap out the JS files it ...