Mvc 4

8
MVC 4.0 - Biren Modi

description

 

Transcript of Mvc 4

Page 1: Mvc 4

MVC 4.0

- Biren Modi

Page 2: Mvc 4

MVC Framework MVC Project Templates

Features of MVC 4.0

Page 3: Mvc 4

MVC 4 FrameworkController to other project folder :

Page 4: Mvc 4

Previous Version In MVC 4.0public class Products : AsyncController {

public void IndexAsync() {

    WebClient wc1 = new WebClient();

    AsyncManager.OutstandingOperations.Increment();

    wc1.DownloadStringCompleted += (sender, e) => {        AsyncManager.Parameters[“result"] = e.Result;        AsyncManager.OutstandingOperations.Decrement();    };

    wc1.DownloadStringAsync(new Uri("http://www.bing.com/")); }  public ActionResult IndexCompleted(string result) {    return View(); }}

public class Products : Controller {

public async Task<ActionResult> IndexAsync() {

WebClient web = new WebClient();

    string result = await web.DownloadStringAsync("www.bing.com/");     return View(); }}

Task Support for Asynchronous Controllers

Page 5: Mvc 4

public static void RegisterBundles(BundleCollection bundles) { BundleTable.EnableOptimizations = true;

bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js"));

bundles.Add(new StyleBundle ("~/Content/css").Include("~/Content/site.css"));

bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( "~/Content/themes/base/jquery.ui.core.css", "~/Content/themes/base/jquery.ui.theme.css"));

}

 Bundling and Minification

Page 6: Mvc 4

Enabling Logins from Facebook and Other Sites Using OAuth and OpenID

App_Start folder and separate classes ◦ Routing◦ Bundling◦ Filters◦ etc..

Display Modes◦ Desktop◦ Mobile

Azure SDK Database Migrations

Other Features

Page 7: Mvc 4

ASP.NET Web API Mobile Project Template Enhancements to Default Project Templates Empty Project Template

MVC Project Templates

Page 8: Mvc 4

Thank You