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
3 answers

MVC 3 razor layout

I have a MVC 3 project in which I use _Layout.cshtml as master page in all web pages. Now I want to remove this master page (layout) from one of the page (progress.cshtml). So I removed the removed the top portion of the page which was @{ …
pramodtech
  • 6,300
  • 18
  • 72
  • 111
14
votes
4 answers

MVC 3 EF 4.1 dbContext - Deleting one-to-many data object with non-nullable foreign-key relation

I am using MVC 3, EF 4.1, and dbContext. I need to know how to delete an entity in one-to-many relation with a non-nullable foreign-key. When I Remove the child entity and execute SaveChanges I get the error: The operation failed: The relationship…
Max
  • 291
  • 1
  • 3
  • 8
14
votes
6 answers

Multiple Models in a Single View (C# MVC3)

I'm using C# and MVC3. I have a page, for example a Student list, that displays the list of students, which is database driven. At the same time my menu is database driven, so I also have to send it to the view. How can I send both models to a…
czetsuya
  • 4,773
  • 13
  • 53
  • 99
14
votes
1 answer

Exclude .svn from _bin_deployableAssemblies directory?

In VS 2010 for ASP.NET MVC 3 project there is an option to add a "Deployable Dependencies" folder (_bin_deployableAssemblies) (click right button on web project), files contained in this directory will be copied to the /bin directory. If you are…
THX-1138
  • 21,316
  • 26
  • 96
  • 160
14
votes
1 answer

ASP.NET IAuthorizationFilter OnAuthorization

Hi I am trying to implement a custom Authorization filter //The Authourization attribute on a controller public class CustomAdminAuthorizationFilter : IAuthorizationFilter { private readonly IAuthentication _authentication; public…
Mark O'Grady
  • 1,144
  • 3
  • 14
  • 22
14
votes
1 answer

Html.Action() Causes a StackOverflowException

For some reason, one of my Html.Action() methods is throwing a StackOverflowException which is only being caught when I debug the web server instance after it gets stuck and stops responding. All what I get is this: System.StackOverflowException…
Kassem
  • 8,116
  • 17
  • 75
  • 116
14
votes
4 answers

Generating an canonical automatically for mvc3 webapplication

I want to use canonical url's in my website. I read a few things about it on the internet, but i'm looking for a solution which will automatically generate the canonical for me runtime and add it in the html-code returned to the browser. I've…
Rob
  • 6,731
  • 12
  • 52
  • 90
14
votes
2 answers

Ninject.MVC3, Nuget, WebActivator oh my

I want to setup Ninject to do a simple test, as well as demonstrate the ease-of-setup using Nuget. I want to resolve a sample service. public interface ITestService { string GetMessage(); } public class TestService : ITestService { public…
Rob
  • 143
  • 1
  • 5
14
votes
2 answers

How can I use DisplayName data annotations for column headers in WebGrid?

I have a Car class that I'm trying to display in an MVC 3 view using the WebGrid helper. Below are the Car and it's metadata class. Car class: [MetadataType(typeof(CarMetadata))] public partial class Car { // car implementation } Car…
80bower
  • 1,151
  • 1
  • 14
  • 22
14
votes
1 answer

How can I set the ValidateAntiForgeryToken globally

Security at first. MVC best practices reccomend to add the [ValidateAntiForgeryToken] attribute to each [HttpPost] action. How can I enforce this rule in one unique point of the application?
14
votes
5 answers

Exception handling and logging strategy in .NET

I am building a multi-layered application that has an ASP.NET MVC web application. It conists of the usuals like presentation layer, business layer, data layer, etc. How would one create/use a decent exception handling mechanism? I read on…
Brendan Vogt
  • 25,678
  • 37
  • 146
  • 234
14
votes
2 answers

MVC 3 Dependency Resolver or Ninject MVC plugin?

In MVC 3 they added a Dependency Resolver what I been using. While answering someone question someone commented on you should use the Ninject MVC 3 plugin. So my question is why use it over the built in one? If it is the way to go how do you setup…
chobo2
  • 83,322
  • 195
  • 530
  • 832
14
votes
4 answers

Create GridView in asp.net MVC3.0

Is it possible to create grid in asp.net MVc3.0. The gridview that is used in asp.net similar to that if yes then please let me know how to create a simple grid in asp.net mvc3.0 I m using sql server Database to fetch data, that has to be filled in…
user637197
  • 8,897
  • 4
  • 16
  • 6
14
votes
4 answers

Manual form validation in MVC 3 and JQuery

I want to be able to trigger form validation on the client side when the user selects the "GO" button. Currently when the "GO" button is selected it does not validate the complete form. For example, If I load the form and select the "Go" button…
Mike Barlow - BarDev
  • 11,087
  • 17
  • 62
  • 83
14
votes
6 answers

Textboxfor mvc3 date formatting and date validation

I've decided to get started with MVC 3 and I ran into this issue while trying to redo one of my web apps to MVC3. I've got projects setup this way: public class Project { public int ProjectID { get; set; } …
LanFeusT
  • 2,392
  • 5
  • 38
  • 53