asp.net-mvc-2-rtm

Model validation with enumerable properties in Asp.net MVC2 RTM

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...

Problems deploying MVC2 - Could not load type 'System.Web.Mvc.UrlParameter'

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...

How can I know which Area my MVC controller action is being called in?

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 ...

Asp.Net MVC EnableClientValidation doesnt work.

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 { ...

Cannot debug views in MVC2 project, getting "The resource cannot be found" error

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...

MVC2 binding data to view model super slow when using JSON and collections.

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...

MVC2/Jquery validation issues.

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 ...