Showing posts with label MVC. Show all posts
Showing posts with label MVC. Show all posts

Sunday, May 11, 2014

Disable model validations while submitting the form in MVC

Add below line in the top of the view.
@{
           Html.EnableClientValidation(false);
    }

Sunday, January 19, 2014

How long the view location will be cached in MVC?

The default cache is 15min.

we can extend this using follwing code in Global.asax


var viewEngine = new RazorViewEngine
                         {ViewLocationCache = new DefaultViewLocationCache(TimeSpan.FromHours(24))};
    ViewEngines.Engines.Clear();
    ViewEngines.Engines.Add(viewEngine);

Monday, November 11, 2013

New features in .NET 4.5


  • Async and wait 
  • Zip Compression
  • Regex timeout
  • Improvised garbage collector
  • Profile optimization (Improved startup performance)
  • Set default culture to App Domain  (helpful in working on multi threaded environment)
  • Array support more than two gigabyte size
  • Asynchronous HTTP Modules and Handlers.
  • New Request Validation features in Asp.Net 4.5

Saturday, August 24, 2013

What are the new features introduced in MVC4




  1. ASP.NET Web API
  2. Enhancements to default project Templates
  3. Mobile Project Template
  4. Display Modes
  5. JQuery Mobile
  6. View Switcher
  7. Browser Overriding
  8. Task Support For Asynchronous controller
  9. Empty Project template

Why to go with Editor Templates instead of partial views in MVC?

The problem with partials is that they do not preserve the navigational context. This means that any input fields that you might have put inside this partial will have incorrect names and the default model binder will not be able to retrieve the values back when you POST.


To make partial views to preserve the values while doing the http post we need to pass the top level model(parent view model) to partial view.