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

Avoid hard-coding controller and action names

ASP.NET MVC seems to be encouraging me to use hard-coded strings to refer to controllers and actions. For example, in a controller: return RedirectToAction("Index", "Home"); or, in a view: Html.RenderPartial("Index", "Home"); I don't want…
kristian
  • 22,731
  • 8
  • 50
  • 78
14
votes
3 answers

MVC 3 Razor @Html.ValidationMessageFor not working in partial loaded via jquery.load()

I have put together a small example here just to replicate the problem. I have a strongly typed partial view _Name.cshtml: @model ValidationInPartial.ViewModels.MyViewModel

@ViewBag.Message

Name
Roberto D
  • 143
  • 1
  • 1
  • 5
14
votes
3 answers

what is the difference between ViewData & PageData in asp.net MVC 3?

Well i see this 2 properties but i cant understand the difference between them? I cant seem to find any help anywhere about the PageData propriety. so can any body help? @ { Viewdata["something"] = 1; PageData["something"] = 2; } thanks
Karim
  • 6,113
  • 18
  • 58
  • 83
14
votes
3 answers

How to properly authenticate mvc-mini-profiler with AspNetSqlMembershipProvider

I tried to check if the user is in role at Application_BeginRequest and Application_AuthenticateRequest with this code and it will not work. At BeginRequest the code is never hit and Authenticate it's hit with some of the request and the profiler…
Tadeu Maia
  • 1,194
  • 9
  • 20
14
votes
2 answers

Why can't Visual Studio preview MVC Razor View (.cshtml) pages similar to asp/aspx pages?

I enjoy working with ASP.NET MVC 3 using the Razor view engine, but am embarrassed to admit that not having the ability to preview the pages (.cshtml) in the Visual Studio designer negatively affects my productivity. Is there a fundamental reason…
Rich Bianco
  • 4,141
  • 3
  • 29
  • 48
14
votes
2 answers

how do you override the rendering of the Navigation zone in Orchard CMS?

I'm new to Orchard, so I probably have no idea what I'm doing. I've figured out how to override different shapes but putting a cshtml file in the View folder with the same name as the shape. Also, I found the Menu and MenuItem shape cshtml files…
Zack
  • 2,291
  • 2
  • 23
  • 38
14
votes
3 answers

Open PDF result in browser tab with MVC 3

I am using ASP.NET MVC 3. I have a controller action that returns a PDF file like this: Public Class ReportController ... Function Generate(id As Integer) As ActionResult ... Return File(output, "application/pdf",…
Endy Tjahjono
  • 24,120
  • 23
  • 83
  • 123
14
votes
12 answers

Razor Intellisense Not Working VS2010 SP1Rel MVC3 from WPI Win7 x64

I have Visual Studio 2010 /SP1 / MVC 3 (With April Tools Update) installed on a machine with a fresh install of Windows 7 64-bit Professional. I do not have resharper installed. I never installed an RC or Beta of anything on this new OS Install.…
j0tt
  • 1,108
  • 1
  • 7
  • 16
14
votes
2 answers

Json is being cached incorrectly

Hy! My JS is requesting a JSON from controller to edit an existing object, a populated dropdownlist. Then, the View send the actual values from my autosuggest dropdown, to lately the new value be compared to the old one and the new values be…
Thiago
  • 1,547
  • 3
  • 25
  • 40
14
votes
3 answers

Correct way to handle Ajax calls in ASP.Net MVC 3

When coding up Ajax calls in ASP.Net MVC we have a lot of options as far as issuing calls, handling them on the server, and dealing with successes and failures on the client. Some things clearly have a correct answer, but I've been unable to find…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
14
votes
4 answers

two decimal places for decimal/money field

I have a table with money field in my database. I have created entity and created decimal property for that money field. When the value of that field is displayed on My MVC3 view, It has four zeros 0000 after decimal like this : 5489.0000. I want to…
DotnetSparrow
  • 27,428
  • 62
  • 183
  • 316
14
votes
3 answers

How to deal with more than one value per key in ASP.NET MVC 3?

I have the following problem: one of the system I'm working in most important features is a search page. In this page I have some options, like records per page, starting date, ending date, and the problematic one: type. One must have the…
Bruno Machado - vargero
  • 2,690
  • 5
  • 33
  • 52
14
votes
4 answers

Enterprise ASP.NET MVC 3 architecture outline

I've gotten lucky enough to work on a completely new enterprise MVC 3 project. And by new, I mean source control is literally empty at this point. We're trying to figure out how to lay out out the solution and various projects that will be…
FoobarisMaximus
  • 1,109
  • 3
  • 13
  • 18
14
votes
3 answers

Mvc 3 Image Upload Gallery

I have implemented a file upload for images using ASP.NET Mvc 3 and the Microsoft.Web.Helpers NuGet package. The implementation is quit simple as it allows you to browse for a file and upload it to a specified directory. Here is what I have for my…
Carl Weis
  • 6,794
  • 15
  • 63
  • 86
14
votes
5 answers

ASP .NET MVC 3 Data Annotations GreaterThan LowerThan for DateTime and int

I would like to know what is the easiest way to have a "Greater Than" & "Lower Than" validation on a ASP.NET MVC 3 form? I use unobtrusive JavaScript for client validation. I have two DateTime properties (StartDate & EndDate) and I need a validation…
user742898
  • 141
  • 1
  • 1
  • 5