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

Is Response.Write() working with Razor?

Is Response.Write() working with Razor? I tried to use @Html.RenderAction but I'm getting the error: CS1502: The best overloaded method match for 'Microsoft.WebPages.WebPageUltimateBase.Write(Microsoft.WebPages.Helpers.HelperResult)' has some…
stacker
  • 14,641
  • 17
  • 46
  • 74
14
votes
4 answers

Could not load file or assembly System.Web.Mvc or one of its dependencies

currently working on asp.net mvc5 (old mvc3 project). It builds just fine, but when I start the project but when I run the project I am facing the following error. Could not load file or assembly 'System.Web.Mvc' or one of its dependencies. The…
Joakim Carlsson
  • 1,540
  • 5
  • 19
  • 42
14
votes
5 answers

ASP.Net MVC C# Chrome not showing date in edit mode

I am using Google Chrome V28 as my browser - and have a problem with the DataAnnotations on my model, which force Chrome to use it's own inbuild calendar when rendering a datatime type in my view. My model is: public class ObScore { public int…
Mark
  • 7,778
  • 24
  • 89
  • 147
14
votes
3 answers

How to access JsonResult data when testing in ASP.NET MVC

I have this code in C# mvc Controller: [HttpPost] public ActionResult Delete(string runId) { if (runId == "" || runId == null) { return this.Json(new { error = "Null or empty params" }); } try …
juanchoelx
  • 387
  • 1
  • 6
  • 20
14
votes
8 answers

How to set the value of a hidden field from a controller in mvc

I want to set the value of a hidden field from a controller.How can i do this? In view part i have given like this..
@Html.Hidden("hdnFlag", null, new { @id = "hdnFlag" })
user2156088
  • 2,350
  • 5
  • 20
  • 24
14
votes
3 answers

NHibernate exception: Transaction not connected, or was disconnected

In our develop environment all the ASP.NET application works just fine. However, when I deploy the site on the test machine, on some pages I get this exception: NHibernate.TransactionException: Transaction not connected, or was disconnected at…
Martijn
  • 24,441
  • 60
  • 174
  • 261
14
votes
2 answers

How to add html5 data attribute to Html.TextBox in asp.net mvc?

The Html.TextBox syntax is: public static MvcHtmlString TextBox(this HtmlHelper htmlHelper, string name, object value, object htmlAttributes); So, i put my data attribute in htmlAttributes. I have tried @Html.TextBox("date",Model.Date,new…
cameron
  • 2,976
  • 3
  • 23
  • 35
14
votes
6 answers

Problems with Url.Action helper with multiple route values

I'm currently developing an ASP.NET MVC3 application in VS2010 and I'm having some troubles with @Url.Action helper. I have an ajax request where I use this helper: var url = '@Url.Action("Action", "Controler", new { a = "a", b = "b"…
educampver
  • 2,967
  • 2
  • 23
  • 34
14
votes
2 answers

How do you convert a Razor view to a string?

I would like to use my Razor view as some kind of template for sending emails, so I would like to "save" my template in a view, read it into controller as a string, do some necessary replacements, and then send it. I have solution that works: my…
Vlado Pandžić
  • 4,879
  • 8
  • 44
  • 75
14
votes
1 answer

Why can't my web project find my elmah.axd file

In my web.config file I have all the references to elmah that I need in order to have elmah running. Except this part of the code:
Robert
  • 4,306
  • 11
  • 45
  • 95
14
votes
1 answer

How should I call `EditorForModel` with its parameters?

Before posting this question, I googled for EditorForModel using parameters. I read Why not use Html.EditorForModel() and this blog. I didn't find any articles related to my needs. Can you provide me an example of a call to EditorForModel with…
Snake Eyes
  • 16,287
  • 34
  • 113
  • 221
14
votes
1 answer

Stop User from using last 5 password?

I have a requirement to force a user to change password after 90 Days. This is working fine with something like the below: if (memberUser.LastPasswordChangedDate.Date.AddDays(90) < DateTime.Now.Date) { return…
Ctrl_Alt_Defeat
  • 3,933
  • 12
  • 66
  • 116
14
votes
2 answers

Bootstrap typeahead ajax result format - Example

I am using Bootstrap typeahead with an ajax function, and want to know what is the correct Json result format, to return an Id and a descripcion. I need the Id to bind the typeahead selected element with a mvc3 model. This is the code: [Html] …
Gonzalo
  • 2,866
  • 7
  • 27
  • 42
14
votes
3 answers

Ninject + MVC3 is not injecting into controller

I have used the NuGet Ninject MVC3 extension and have been unable to get it to inject into a controller upon request. It doesn't seem to have bound, as MVC is looking for the paramaterless constructor. Here's the stack trace: …
Traw
  • 325
  • 2
  • 10
14
votes
3 answers

URL.Action with a string array?

I have an array of strings that I need to pass in a query string of Url.Action. Url.Action("Index", "Resource", new { FormatIds = Model.FormatIDs}) Right now the link is showing up in my browser as System.String[] instead of a query string. Is…
user547794
  • 14,263
  • 36
  • 103
  • 152