Top "Asp.net-mvc-3" questions

ASP.

How Should I Declare Foreign Key Relationships Using Code First Entity Framework (4.1) in MVC3?

I have been searching for resources on how to declare foreign key relationships and other constraints using code first EF 4.1 …

asp.net-mvc-3 ef-code-first entity-framework-4.1
Html.EditorFor Set Default Value

Rookie question. I have a parameter being passed to a create view. I need to set a field name with …

c# asp.net-mvc asp.net-mvc-3
Setting Access-Control-Allow-Origin in ASP.Net MVC - simplest possible method

I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access this …

json asp.net-mvc-3 cors asp.net-ajax
How to set a hidden value in Razor

I know that what I'm trying to do is bad idea, but I have specific constrains for now. I have …

asp.net-mvc-3 razor model-view-controller model setdefault
ASP.NET MVC DropDownListFor with model of type List<string>

I have a view with a model of type List<string> and I want to place a drop …

c# asp.net-mvc asp.net-mvc-3 razor html-helper
Localhost not working in chrome and firefox

I am doing a web project using visual studio 2010(MVC3 Razor) and Windows 7. My default browser is IE. When I …

visual-studio-2010 asp.net-mvc-3 razor localhost
ViewBag, ViewData and TempData

Could any body explain, when to use TempData ViewBag ViewData I have a requirement, where I need to set a …

asp.net-mvc-3
Nullable property to entity field, Entity Framework through Code First

Using the data annotation Required like so: [Required] public int somefield {get; set;} Will set somefield to Not Null in …

entity-framework asp.net-mvc-3 code-first nullable
The name 'ViewBag' does not exist in the current context

I am trying to use ViewBag in my application, I have all of the recent dlls, the latest version of …

dll asp.net-mvc-3 gac viewbag
How do I access ViewBag from JS

My attempted methods. Looking at the JS via browser, the @ViewBag.CC is just blank... (missing) var c = "#" + "@ViewBag.CC"; …

c# javascript asp.net asp.net-mvc-3 viewbag