Questions tagged [asp.net-mvc-3]

ASP.NET MVC 3 is the third major version of Model-View-Controller extension for developing web applications in a .NET framework.

ASP.NET MVC 3 is the third major version of the ASP.NET Model-View-Controller platform for web applications.

It supports the following new features:

Demos and Tutorials:

  1. Intro to ASP.NET MVC 3 (VB)
  2. Intro to ASP.NET MVC 3 (C#)

References:

See for more information.

38473 questions
14
votes
1 answer

ASP.NET MVC 3 - posting complex JSON model to action

I am trying to post the following JSON data to an Action method on my controller... { "Id": "0", "VendorId": "5", "FirstName": "g", "LastName": "g", "Sex": "m", "DateOfBirth": "", "Address": "", "City": "", "State": "", "PostCode": "", "Country":…
jdavis
  • 8,255
  • 14
  • 54
  • 62
14
votes
3 answers

Filter is getting lost in WebGrid + Paging + Sorting + Filtering in .NET 4.0

I've implemented a WebGrid. Sorting, paging and filtering do not work together. They work when you use them alone. When you combine the three, at the same time, filtering doesn't work. The symptom: Filter the resultset, then sort. or Filter the…
101010
  • 14,866
  • 30
  • 95
  • 172
13
votes
1 answer

Razor and interface inheritance in ASP.NET MVC3: why can't this property be found?

I have an odd problem with one of my Razor views in an ASP.NET MVC3 application. I am getting an error telling me that a property cannot be found, when the property does seem to exist when I write out its value to the debugger console. My view takes…
Richard
  • 1,219
  • 11
  • 13
13
votes
3 answers

Placing js files in the views folder

I am trying to place my javascript files with my views. I have the following js file location. /Views/Home/Home.js However, when referenced with a script tag, it results in a 404 error. As per the following SO question: ASP.NET MVC - Where do you…
Valamas
  • 24,169
  • 25
  • 107
  • 177
13
votes
2 answers

intellisense with jquery in visual studio 2010

I put those two above. But I get no intellisense with jquery. I also…
13
votes
4 answers

ASP .Net MVC 3: Custom unobtrusive validation

I am trying to add a custom unobtrusive validation to my app. It does not seem to run the validation. Here is my Attribute class: public IEnumerable GetClientValidationRules( ModelMetadata metadata, ControllerContext…
Moon
  • 33,439
  • 20
  • 81
  • 132
13
votes
2 answers

AntiForgeryToken invalid after sign in

I have a form which the user can post without loging in. If however his email is recognized a password is required. The password form is validated over Ajax and if successfull the main form is submitted. Both forms require a valid…
Martin
  • 2,956
  • 7
  • 30
  • 59
13
votes
1 answer

Occasional "The underlying provider failed on Open" errors when using EF4 (edmx model)

I hope someone can help me with a solution to the following error. The application in which the error happens is running in production and I never experience the error myself. However around 20 times a day I receive an error mail telling me: The…
hylle
  • 133
  • 1
  • 1
  • 5
13
votes
7 answers

"Child actions are not allowed to perform redirect actions"

I have this error: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. with inner exception: Child actions are not allowed to perform redirect actions. Any idea why this…
Sachin Kainth
  • 45,256
  • 81
  • 201
  • 304
13
votes
5 answers

SignalR - StartUp

I am looking for the quick and dirty answer. I am just blanking, and after staring at a screen for over 12 hours now, I think I am shot. I want to do a simple SignalR application as a tutorial. I found this example, but I keep getting the error…
bdparrish
  • 3,216
  • 3
  • 37
  • 58
13
votes
6 answers

Error 1 The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?)

When I try to build the project in asp.net mvc3. 27 errors appearing, saying that the mvc related classes dont exist: Here is an example of one: Error 1 The type or namespace name 'Controller' could not be found (are you missing a using…
Dmitry Makovetskiyd
  • 6,942
  • 32
  • 100
  • 160
13
votes
1 answer

Looking for direction on unit testing a controller extension that renders a partial view

As the title says, I'm looking for direction on how to properly test a controller extension. The extension renders a partial view which in turn I'm using within a JSONResult: public static string RenderPartialViewToString(this Controller…
Jesse
  • 8,223
  • 6
  • 49
  • 81
13
votes
4 answers

Sequence contains more than one matching element - Adding item with Entiity Framework

I've googled this and don't get any answers for my particular circumstance. Im using Entity Framework in a suposedly simple way. I'm trying to add a record to the Memberproduct table. However I'm getting an exception that doesn't make sense. Any…
gunwin
  • 4,578
  • 5
  • 37
  • 59
13
votes
3 answers

Creating a AuthorizeAttribute - what do I need to know?

Here are my requirements: I'll be adding users to N amount of roles; defined in a database. I need to protect each controller action with my authorize attribute. For example, the web application would check if the logged in user belongs to either…
Only Bolivian Here
  • 35,719
  • 63
  • 161
  • 257
13
votes
3 answers

How can I set TextBoxFor to be hidden by default

I have a view in MVC3 with a TextBoxFor bound to my model like so: <%=Html.TextBoxFor(m => m.SomeProperty, new { @readonly = "readonly" }) %> How could I change this to be a textbox which would have style="display: none;" by default?
Stian
  • 1,261
  • 2
  • 19
  • 38
1 2 3
99
100