Top "Asp.net-mvc-3" questions

ASP.

What's the difference between ViewData and ViewBag?

I saw the ViewBag in MVC 3. How's that different than ViewData in MVC 2?

.net asp.net-mvc-3 difference viewbag viewdata
Stop form from submitting , Using Jquery

I'm trying to stop my form from submitting if a validation fails. I tried following this previous post but I …

jquery asp.net-mvc-3 validation preventdefault
Getting "A potentially dangerous Request.Path value was detected from the client (&)"

I've got a legacy code issue that requires that I support random urls as if they were requests for the …

asp.net-mvc asp.net-mvc-3
EF LINQ include multiple and nested entities

Ok, I have tri-leveled entities with the following hierarchy: Course -> Module -> Chapter Here was the original …

.net asp.net-mvc-3 linq entity-framework entity-framework-5
Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0

I just upgraded packages in an MVC 3 project (ASP.net 4), and now I am getting the following error message when …

asp.net-mvc-3 razor dependencies asp.net-4.0
Multiple types were found that match the controller named 'Home'

I currently have two unrelated MVC3 projects hosted online. One works fine, the other doesn't work, giving me the error: …

c# asp.net-mvc-3 controller
How to use ternary operator in razor (specifically on HTML attributes)?

With the WebForms view engine, I'll commonly use the ternary operator for very simple conditionals, especially within HTML attributes. For …

razor asp.net-mvc-3
ASP.Net MVC – Resource Cannot be found error

I am completely new to ASP.Net MVC. I just created an MVC3 project in Visual Studio 2010. The view engine …

asp.net asp.net-mvc asp.net-mvc-3 razor
Disable Required validation attribute under certain circumstances

I was wondering if it is possible to disable the Required validation attribute in certain controller actions. I am wondering …

c# asp.net-mvc asp.net-mvc-3 data-annotations
Two models in one view in ASP MVC 3

I have 2 models: public class Person { public int PersonID { get; set; } public string PersonName { get; set; } } public class Order { public …

asp.net-mvc-3 viewmodel