asp.net-mvc-2

Why are there so many javascript files in my empty MVC 2 project?

When creating an empty MVC 2 project, I have a lot of javascript files in my Scripts folder. Why? Will removing them affect my application? ...

ASp.Net MVC 2 Performance

What is the latest data on ASP.Net MVC performance? How does it scale and perform under heavy load? I have profiled my ASP.Net MVC 1 application and most of the time is wasted in System.Web.MVC assembly, so I thought it might be a concern. ...

Limit controllers to specific area only

I have one Area and in AreaRegistration I defined namespace all controllers in area belongs to. context.MapRoute( "Admin_default", "Admin/{controller}/{action}/{id}", new { controller="Home", action = "Index", id = UrlParameter.Optional }, new[] { "MySite.Admin.Controllers"...

JqGrid doesn't work in ASP.NET MVC2

I have a project in ASP.NET MVC1 using VB.NET controlers and JqGrid. it works fine under MVC1. After migrating the project to ASP.NET MVC2, the grid is no longer populated. It seems that there is some new restrictions on returned Jsonresult in MVC2. How to solve this in VB.NET. Controler function populating the jqgrid is something like t...

How can I make this Route (ASP.Net MVC2) ?

Hi All, I'm begginer in asp.net mvc and I have some doutbs about routes. Im' developing a system to manage documents and I need make an URL like this: routes.MapRoute("Documentos", "{controller}/{documentType}/{documento}/{action}/{id}", new { controller = "Home", ...

How can I set a jQuery tab number that's present in an ASP.NET MVC model?

Hi, I have an ASP.NET MVC view on which I've placed jQuery tabs. I'm loading the tabs using: function getContentTab(index) { var url='<% = Url.Content("~/Books/GetBookTab") %>/' + index; ... } I have stored the user's default tab selection in the model associated with this view. My question is this, how can I set the tab ...

How to change ErrorMessage property of the DataAnnotation validation in MVC2.0

My task is to change the ErrorMessage property of the DataAnnotation validation attribute in MVC2.0. For example I should be able to pass an ID instead of the actual error message for the Model property and use that ID to retrieve some content(error message) from a another service e.g database, and display that error message in the View ...

When are ASP.NET MVC 2 textbooks going to hit the shelves?

I am itching to learn this technology, but books on amazon.co.uk are still saying "This title has not yet been released. You may pre-order it now and we will deliver it to you when it arrives." ...

MVC2 and MVC Futures causing RedirectToAction issues

I've been trying to get the strongly typed version of RedirectToAction from the MVC Futures project to work, but I've been getting no where. Below are the steps I've followed, and the errors I've encountered. Any help is much appreciated. I created a new MVC2 app and changed the About action on the HomeController to redirect to the Inde...

MVC 2 Conversion Disrupts the parameters passed to my Stored Procedure

I have a few textboxes that are not required. If the user enters nothing it is passed as 'null' in MVC 2. It was passed as '""' in MVC 1. What changes can I make to accomodate for this? public string Name { get; set; } public string Offer{ get; set; } public string AutoID { get; set; } using (SqlConnection conne...

ASP.NET MVC 2.0 Validation and ErrorMessages

I need to set the ErrorMessage property of the DataAnnotation's validation attribute in MVC 2.0. For example I should be able to pass an ID instead of the actual error message for the Model property, for example... [StringLength(2, ErrorMessage = "EmailContentID")] [DataType(DataType.EmailAddress)] public string Email { get; s...

ASP.NET MVC2 - How to have a non-required field?

Hi there All my fields seem to be required by default as I am getting a server-validation message "enter title" in my validation summary box. How do I make this field not required? I havent declared anything explicitly in the ViewModel & the front-side code is simply Html.DropDownListFor Any help would be really appreciated~! ...

How to page while maintaining the querystring values in ASP.Net Mvc 2

I am using the pager provided by Martijn Boland to implementing paging in my Asp.Net Mvc 2 application. My form uses the GET method to send all parameters to the querystring, it is a search form with several form elements. <% using (Html.BeginForm("SearchResults", "Search", FormMethod.Get)) {%> On the SearchResults View I am t...

asp.net mvc2 microsoftMvcJqueryValidation - Include my custom client-side function

Hi there I'm using microsoftMvcJqueryValidation and I want to call my own client-side validation function for a particular field with the system so that it fires with the other auto generated client-side validation. Is there a certain place I can call my function? Thanks~! ...

Optional route parameters in ASP.NET 4 RTM no longer work as before

I upgraded my project to ASP.NET 4 RTM with ASP.NET MVC 2.0 RTM today. I was previously using ASP.NET 3.5 with ASP.NET MVC 2.0 RTM. Some of my routes don't work suddenly and I don't know why. I'm not sure if something changed between 3.5 and 4.0 - or if this was a regression type issue in the 4.0 RTM. (I never previously tested my app ...

Is ToValueProvider() changed in ASP.NET MVC2?

I applied sample codes with the book Pro ASP.NET MVC Framework. [AcceptVerbs(HttpVerbs.Post)] public ViewResult CheckOut(Cart cart, FormCollection form) { if (cart.Lines.Count == 0) { ModelState.AddModelError("Cart", "Sorry, your cart is empty"); return View(); } if (TryUp...

Do I need to un-install aspnet mvc2 for vs2008 before installing vs2010?

I just grabbed vs2010 release from msdn and I wanted to find out if anyone had any issues installing this on a machine that had mvc2 installed already for use with vs2008. ...

Multiple Controllers with one Name in ASP.NET MVC 2

I receive the following error when trying to run my ASP.NET MVC application: The request for 'Account' has found the following matching controllers: uqs.Controllers.Admin.AccountController MvcApplication1.Controllers.AccountController I searched the project for MvcApplication1.Controllers.AccountController to remove it, but I c...

Returning a JSON view in combination with a boolean

What i would like to accomplish is that a partiel view contains a form. This form is posted using JQuery $.post. After a successfull post javascript picks up the result and uses JQuery's html() method to fill a container with the result. However now I don't want to return the Partial View, but a JSON object containing that partial view...

ASP.NET MVC 2 : How to call DisplayFor for each item in a collection ?

I have property in my model which is a collection type (List). I'd like to call for each item in this collection Html.DisplayFor or Html.EditorFor. How can I do this ? EDIT It's not a strong-typed view. It's a templated view. There is only ViewData.ModelMetadata. ...