What's new in ASP.NET 4

3,512 views
3,450 views

Published on

ASP.NET has evolved a lot in the last few years with the addition of ASP.NET MVC and Dynamic Data, as well as the continuous improvement of WebForms and ASP.NET AJAX. This session will provide a roadmap of the changes that are coming with ASP.NET 4 and Visual Studio 2010.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,512
On SlideShare
0
From Embeds
0
Number of Embeds
231
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Hidden fields used to be just in a div, but since there is no meta on it - it can be horrid with styling
  • Checkboxes and radio buttonsed used to be just dropped in a span, but since they are list items they are now in a list and you can pick if it is ordered or unordered.
  • What's new in ASP.NET 4

    1. 1. What’s new in ASP.NET 4?<br />
    2. 2. Your presenter for today?<br />Robert MacLean<br />sadev.co.za<br />@rmaclean<br />
    3. 3. What to expect<br />
    4. 4. Massive Investment - CSS<br /><div><br /><%--Hidden Content --%><br /></div><br /><divclass="aspNetHidden"><br /><%--Hidden Content --%><br /></div><br />
    5. 5. Massive Investment - Standards<br /><spanid="chkboxlst"><br /><inputid="chkboxlst_0"type="checkbox"/><br /> <labelfor="chkboxlst_0">Check Box 1</label><br /><inputid="chkboxlst_1"type="checkbox"/><br /> <labelfor="chkboxlst_1">Check Box 2</label><br /><inputid="chkboxlst_2"type="checkbox"/><br /> <labelfor="chkboxlst_2">Check Box 3</label><br /></span><br /><ulid="chkboxlst"><br /> <li><inputid="chkboxlst_0"type="checkbox"/><br /> <labelfor="chkboxlst_0">Check Box 1</label></li><br /><li><inputid="chkboxlst_1"type="checkbox"/><br /> <labelfor="chkboxlst_1">Check Box 2</label></li><br /><li><inputid="chkboxlst_2"type="checkbox"/><br /> <labelfor="chkboxlst_2">Check Box 3</label></li><br /></ul><br />
    6. 6. ASP.NET 4<br /><demo/><br />
    7. 7. CDN’s<br />Web Server<br />Web Server<br />Web Server<br />jQuery<br />24k<br />jQuery<br />24k<br />jQuery<br />24k<br />Browser<br />
    8. 8. CDN’s<br />Web Server<br />Web Server<br />Web Server<br />CDN<br />jQuery<br />24k<br />Browser<br />
    9. 9. What does MS CDN offer? <br />jQuery<br />jQuery Validation<br />Ajax Control Toolkit<br />ASP.NET Ajax<br />ASP.NET MVC JavaScript Files <br />
    10. 10. Client ID - Predictable<br /><divid="ctl00_ContentPlaceHolder1_ParentPanel"><br /><divid="ctl00_ContentPlaceHolder1_ParentPanel_NamingPanel1"><br /><inputid="ctl00$ContentPlaceHolder1$ParentPanel$NamingPanel1$TextBox1"<br />type="text"value="Hello!"/><br /></div><br /><divid="ParentPanel1"><br /><divid="ParentPanel1_NamingPanel1"><br /><inputid="ParentPanel1_NamingPanel1_TextBox1"<br />type="text"value="Hello!"/><br /></div><br />
    11. 11. Web.ConfigTransforms<br />Locator<br />Magic (i.e. only one, like custom errors)<br />Match Attributes<br />Partial XPath (Conditions)<br />Full XPath<br />
    12. 12. Web.ConfigTransforms<br />Transform<br />Replace<br />Remove<br />RemoveAll<br />Insert<br />SetAttributes<br />RemoveAttributes<br />InsertAfter<br />InsertBefore<br />
    13. 13. ASP.NET 4 SCRIPT<br />PREP for demos<br />Open 2 copies of Visual Studio<br />Open IIS and warm it up<br />Open up MVC tools folder<br />Rule 18<br />Win++<br />
    14. 14. New project -> web form,. Point out Standards<br />New project -> empty web project<br />Add files from tools<br />Open weform.aspx, drag on image (Nice to show Document format, Ctrl+K,D)<br />Add id to image [Ctrl+1]<br />Open site.master, drag on jquery<br />Script snippet<br />Add $( to script -> show the intellisense, explain the vsdoc<br />Finish the jquery to enable click on image [Ctrl+2]<br />$(document).ready(function () {<br /> $("#vs2010image").click(function () {<br /> alert("Visual Studio 2010 Rocks");<br /> });<br />});<br />[ 3 SLIDES explaining CDN]<br />Change jQuery to CDN [Ctrl+3]<br />Switch to design mode and drag the scriptmanager on to it (good to show toolbox searching)<br />Properties for scriptmanager and enablecdn<br />Add meta keywords and description (HTML style) to master page [Ctrl+4]<br />Switch to webform<br />Add meta keywords and description (@Page style) [Ctrl+5]<br />F7 to code behind<br />Add meta keywords and description to pageload [Ctrl+6] nice to point out new intellisense feature using this.meta<br />Add two labels and a button to web page [Ctrl+7]<br />Add run time setting of labels [Ctrl+8]<br />if (!IsPostBack)<br /> {<br /> this.Label1.Text = this.Label2.Text = "Set at runtime";<br />}<br />DEMO!!<br />Add ViewStateMode="Disabled“ to @Page [Ctrl+9]<br />Add ViewStateMode="Enabled“ to second label [Alt+1]<br />DEMO!!<br />F12, IE Dev Tools, use click and point to second label and show the id of span. Why is this bad?<br />Add ClientIDMode="Static“ to @Page [Alt+2]<br />[1 SLIDE explaining predicatable for looping, table like things – panel/panel/textbox]<br />Drag on chart control – design mode and show types from action button. Go for pie.<br />Properties for chart, ChartArea, 3d, enable 3d, change Inclination to 60<br />On PageLoad add RandomData to chart [Alt+3]<br />RandomDatarandomData = new RandomData();<br /> Chart1.Series[0].Points.DataBindY(randomData.RandomDouble(10));<br />
    15. 15. New project -> MVC<br />No to unit tests<br />Add new area (Blog) from right click on solution<br />Add POSTS model from MVC tools<br />Add POSTS controller, from right click<br />Add folder (Posts) to view FIRST<br />Add view (Index) from right click to posts folder<br />Modifiy the route registration in BlogAreaRegistration.cs [Alt+4] new { controller = "Posts", action = "Index", id = UrlParameter.Optional }<br />Demo!!<br />Add new view- named create. Strongly tie it to the Models.PostModel class and set the view content to Create<br />Show the new labelfor and textboxfor options<br />Now show the PostModel and explain the data validations – Required, StringLength, RegularExpression<br />Add two controller actions for create [ALT+5] point out the new Attribute replacing AcceptVerb attribute<br />public ActionResult Create()<br /> {<br /> return View();<br /> }<br /> [HttpPost]<br /> public ActionResult Create(PostModel model)<br /> {<br /> return View();<br /> }<br />DEMO!!! – add numbers to tags and hit create button. Show the cool validation stuff<br />Explain that text area for content is too small<br />Drag editor templates from Tools, explain ascx control. Explain name and how it ties back to the UIHint attribute in the model<br />Change the textboxfor in the create for body to editorfor<br />DEMO!!!!<br />Add new item – new web form to root and call it list.aspx<br />Drag on grid view, set auto generate select etc.. Set colour<br />F7 code behind – on load add [ALT+6]<br />Open global.asax and before the map routes add the mappageroute [ALT+7]<br />DEMO !!! <br />Jump back to page load and paste in [ALT+8]<br />Next [ALT+9] and explain it won’t work with routes<br />Next {Ctrl+Alt+1] and explain 302 temp<br />Finally [Ctrl+Alt+2] and explain 301 perm<br />DEMO!!! – point out time and talk about caching<br />Add reference (YEAH SPEED) to System.Runtime.Caching<br />Change on load for lists.aspx page to the [CTRL+ALT+3]<br />DEMO!!! - Talk about velocity<br />URL will be http://localhost/Blog/Posts<br />
    16. 16. Right click solution and go to package options<br />Explain package web and package SQL – Make sure you untick the include DB on the web page, since the file does not exist<br />Right click build deployment package<br />IIS -> Website -> Import package -> Explain options -> Finish -> Browse<br />Back to VS and web.config (nice to do Ctlr+K,D)-> Show the ARROW<br />Explain the config issue<br />Open the release one and remove first big comment and put [CTRL+ALT+4] there.<br />Replace second big comment and put [CTRL+ALT+5] there.<br />Explain build scenario issue<br />Right click on the solution and go publish, and explain it<br />Publish<br />SLIDES!<br />
    17. 17. Questions and Answers<br />Reminder: www.sadev.co.za<br /><questions/><br />
    18. 18. We Want To Hear From You!<br />Connect with Microsoft South Africa's Developer & Platform Group<br />blogs.msdn.com/southafrica<br />twitter.com/msdevsa<br />Microsoft DevsSA<br />Required Slide<br />
    19. 19. Required Slide<br />Win a Wireless Entertainment Desktop 8000!<br />Complete your evaluation and enter to win!<br />
    20. 20. Submit an Entry Form at the BB&D Stand and Win*!A Dell Netbook valued at R4,000<br />* Terms & conditions apply<br />
    21. 21. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.<br />The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.<br />

    ×