All Questions

726
votes
18answers
294624 views

File Upload ASP.NET MVC 3.0

I want to upload file in asp.net-mvc. How can I upload the file using html input file control?
252
votes
8answers
308912 views

Using Ajax.BeginForm with ASP.NET MVC 3 Razor

Is there a tutorial or code example of using Ajax.BeginForm within Asp.net MVC 3 where unobtrusive validation and Ajax exist? This is an elusive topic for MVC 3, and I cannot seem to get my form to w...
240
votes
6answers
251398 views

Returning a file to View/Download in ASP.NET MVC

I'm encountering a problem sending files stored in a database back to the user in ASP.NET MVC. What I want is a view listing two links, one to view the file and let the mimetype sent to the browser de...
234
votes
9answers
284661 views

Multiple models in a view

I want to have 2 models in one view. The page contains both LoginViewModel and RegisterViewModel. e.g. public class LoginViewModel { public string Email { get; set; } public string Password ...
189
votes
8answers
128075 views

ViewBag, ViewData and TempData

Could any body explain, when to use TempData ViewBag ViewData I have a requirement, where I need to set a value in a controller one, that controller will redirect to Controller Two and Controlle...
303
votes
5answers
134157 views

Why is JsonRequestBehavior needed?

Why is Json Request Behavior needed? If I want to restrict the HttpGet requests to my action I can decorate the action with the [HttpPost] attribute Example: [HttpPost] public JsonResult Foo() { ...
24
votes
1answers
16309 views

Persisting jqGrid column preferences

I've got a few jqGrids on my ASP.NET MVC 3 application that have a number of columns. I added the following to the column definitions to default some columns to be hidden: colModel: [ { name: 'Ic...
774
votes
7answers
405559 views

Entity Framework 5 Updating a Record

I have been exploring different methods of editing/updating a record within Entity Framework 5 in an ASP.NET MVC3 environment, but so far none of them tick all of the boxes I need. I'll explain why. ...
40
votes
3answers
13712 views

MVC3 and Entity Framework

My question is pretty simple: is it a good practice to place the .edmx file in the model folder in a Web application of an MVC3 project?
149
votes
10answers
49856 views

Dynamic Anonymous type in Razor causes RuntimeBinderException

I'm getting the following error: 'object' does not contain a definition for 'RatingName' When you look at the anonymous dynamic type, it clearly does have RatingName. I realize I can do this ...

Previous Next