Skip to main content

Posts

Showing posts with the label ASP.NET MVC 4.0 Features

MVC Anti forgery for HTTP Headers validator

/ / WEB API ANTIFORGERY CUSTOM ACTION FILTER ATTRIBUTE public class AntiForgeryValidateRequests : BaseActionFilterAttribute { public override void OnActionExecuting(HttpActionContext filterContext) { if (filterContext ! = null & & filterContext.RequestContext ! = null & & filterContext.Request ! = null ) { string cookieToken = "" ; string formToken = "" ; IEnumerable < string > tokenHeaders = filterContext.Request.Headers.GetValues( Constant .RequestVerificationToken); if (tokenHeaders ! = null & & tokenHeaders. Count () > 0 ) { string [] tokens = tokenHeaders. First ().Split(':'); if (tokens. Length = = 2 ) { cookieToken = tokens[ 0 ].Trim(); formToken = tokens[ 1 ].Trim(); } } System.Web...

What's New In MVC 4? - Key Features of MVC 4

The MVC is a framework, standard pattern for developing Web applications and MVC framework handled by three objects Model, View and Controller. Previously, MVC 3 contains only three templates i.e. 1.       Empty Template 2.       Intranet Application Template 3.       Intranet Application Template Now, MVC 4 contains as following – 1.       MVC 4 introduced a popular new feature that is called Web API framework and its work over the HTTP services. 2.       MVC 4 added and improves to default project templates. 3.       MVC 4 introduced to empty project template. 4.       MVC 4 introduced to new mobile project template. 5.       MVC 4 is going to support and adding controller to other project folders. 6.       MVC 4 is going to support ...