Future ASP.NET features for UID / HTML developers Mark Everard September 2010
<ul><li>ASP.NET WebForms History </li></ul><ul><li>Baby Steps – WebForms in  ASP.NET 4.0 </li></ul><ul><li>Giant Leaps – M...
<ul><li>Developed as the Display technology for the first release of ASP.NET in 2000 </li></ul><ul><li>Designed to mimic W...
<ul><li>Some side effects……… </li></ul><ul><ul><li>Markup that was abstracted and difficult to change </li></ul></ul><ul><...
<ul><li>Introduces some new features that will make your lives a little easier…. </li></ul><ul><ul><li>Full control over c...
<ul><li>WebForms generates ID attributes for any server created markup (allows the server to uniquely identify each elemen...
<ul><li>WebForms 4.0 offers 4 modes of operation for Client ID generation </li></ul><ul><ul><li>AutoID (.NET 3.5 behaviour...
<ul><li>Developers are also beginning to find WebForms a pain (though not necessarily for the same reasons as you guys) </...
<ul><li>ASP.NET MVC </li></ul><ul><li>Model / View / Controller </li></ul><ul><li>Simpler framework </li></ul><ul><li>Easi...
<ul><li>ASP.NET MVC built on top of the WebForms framework </li></ul><ul><li>Still working with </li></ul><ul><ul><li>.asp...
<ul><li>Other ViewEngines available that use files with different extensions and different code syntax </li></ul><ul><li>R...
<ul><li>UID developers to </li></ul><ul><li>Work alongside technical developers  </li></ul><ul><li>No longer create static...
<ul><li>Only ‘Greenfield’ projects will be MVC / WebForms 4.0 </li></ul><ul><li>Still have to deal with existing </li></ul...
<ul><li>Developing HTML views for ASP.NET applications will get a lot easier and more enjoyable in the very near future ……...
Upcoming SlideShare
Loading in …5
×

Future ASP.NET features for UID / HTML developers

3,476 views

Published on

A talk I gave internally at Fortune Cookie - covering some of the new features in WebForms 4.0 and MVC which will aid HTML integration and work processes.

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

No Downloads
Views
Total views
3,476
On SlideShare
0
From Embeds
0
Number of Embeds
463
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Primary display technology – though ASP.NET is more than just WebForms Strongly Typed and compiled .aspx files taught to contain little or no code (AKA spaghetti code) - .aspx domain of UID / CodeBehind for TD Event driven – button click event / dropdown list index changed – where as the underlying web framework (Http GET Post) is more simple than that Just functions as request / response Political choice to bring across all VB windows developers to the new web paradigm Postbacks – would perform a Http Post of the entire page / form with viewstate containing the hashed value of the previous state of every servber control
  • How many more can they think of?
  • Visual Studio to show Page with Simple server controls with different client ids modes
  • Full test coverage is the safest way to ensure quality Many WebForm .Net developers won’t know the basic differences between a GET and a POST
  • Simple MVC app walkthrough Concept of Model Controller responsibility View HtmlHelpers
  • &lt;%: %&gt; Html encode notation
  • Simple Nhaml example Razor example
  • Fully integrated development
  • Fully integrated development
  • Future ASP.NET features for UID / HTML developers

    1. 1. Future ASP.NET features for UID / HTML developers Mark Everard September 2010
    2. 2. <ul><li>ASP.NET WebForms History </li></ul><ul><li>Baby Steps – WebForms in ASP.NET 4.0 </li></ul><ul><li>Giant Leaps – MVC </li></ul><ul><li>View Engines, Razor, HAML </li></ul>Overview
    3. 3. <ul><li>Developed as the Display technology for the first release of ASP.NET in 2000 </li></ul><ul><li>Designed to mimic Windows (form) application development </li></ul><ul><li>Provided better code separation than classic ASP </li></ul><ul><ul><li>.aspx (markup files) </li></ul></ul><ul><ul><li>.aspx.cs / .aspx.vb (codebehind files) </li></ul></ul><ul><li>Event driven and provides a means of maintaining state between sequential requests (ViewState) </li></ul>WebForms History
    4. 4. <ul><li>Some side effects……… </li></ul><ul><ul><li>Markup that was abstracted and difficult to change </li></ul></ul><ul><ul><li>Single form elements encompassing the page </li></ul></ul><ul><ul><li>Large page weights. </li></ul></ul><ul><ul><li>Non-standards based markup </li></ul></ul><ul><ul><li>Difficult javascript integration </li></ul></ul><ul><ul><li>… </li></ul></ul><ul><ul><li>… </li></ul></ul><ul><ul><li>… </li></ul></ul><ul><ul><li>… </li></ul></ul><ul><ul><li>And probably many more... </li></ul></ul>Sorry
    5. 5. <ul><li>Introduces some new features that will make your lives a little easier…. </li></ul><ul><ul><li>Full control over client IDs </li></ul></ul><ul><ul><li>More of a focus on semantic and standards based markup </li></ul></ul><ul><li>But the overriding framework remains </li></ul><ul><ul><li>ViewState </li></ul></ul><ul><ul><li>Server Controls (runat=server) </li></ul></ul>WebForms 4.0
    6. 6. <ul><li>WebForms generates ID attributes for any server created markup (allows the server to uniquely identify each element even if componentised in the code) </li></ul><ul><li>ctl00_ContentPlaceholder1_ListView1_ctrl0_Label1 </li></ul><ul><li>Not very friendly (although following a pattern). Not good for any JS interaction with the DOM </li></ul>Client IDs
    7. 7. <ul><li>WebForms 4.0 offers 4 modes of operation for Client ID generation </li></ul><ul><ul><li>AutoID (.NET 3.5 behaviour) </li></ul></ul><ul><ul><li>Predictable (Default) — Trims any “ ctl00 ” ID string and if a list/container control concatenates child ids (example: id=”ParentControl_ChildControl”) </li></ul></ul><ul><ul><li>Static —Hands over full ID naming control to the developer – whatever they set as the ID of the control is what is rendered (example: id=”JustMyId”) </li></ul></ul><ul><ul><li>Inherit —Tells the control to defer to the naming behavior mode of the parent container control </li></ul></ul>ClientIDMode
    8. 8. <ul><li>Developers are also beginning to find WebForms a pain (though not necessarily for the same reasons as you guys) </li></ul><ul><li>Hard to write unit tests for </li></ul><ul><li>Is an abstraction too far -> masks the true simplicity (RESTFUL nature) of the Http protocol </li></ul>Bye-bye WebForms
    9. 9. <ul><li>ASP.NET MVC </li></ul><ul><li>Model / View / Controller </li></ul><ul><li>Simpler framework </li></ul><ul><li>Easier to test </li></ul><ul><li>No ViewState </li></ul><ul><li>No Postbacks </li></ul><ul><li>No WebControls </li></ul><ul><ul><li>~ runat=server </li></ul></ul><ul><li>FULL CONTROL OVER </li></ul><ul><li>MARKUP – Yay  </li></ul>The Future
    10. 10. <ul><li>ASP.NET MVC built on top of the WebForms framework </li></ul><ul><li>Still working with </li></ul><ul><ul><li>.aspx (Page / View) </li></ul></ul><ul><ul><li>.ascx (User control / Partial View) </li></ul></ul><ul><ul><li>.master (MasterPage) </li></ul></ul><ul><li>Views will now contain some code within them (just for display -> loops to output lists) </li></ul><ul><ul><li><%=foreach(var comment in Model.comments) { %> </li></ul></ul><ul><ul><li><li><%:comment.Body%></li> </li></ul></ul><ul><ul><li><%= } %> </li></ul></ul>ViewEngines
    11. 11. <ul><li>Other ViewEngines available that use files with different extensions and different code syntax </li></ul><ul><li>Razor (likely to become the default view engine) .cshtml files </li></ul><ul><li>@foreach (var comment in Model.comments { <li>@comment.Body</li> } </li></ul><ul><li>NHaml - markup language to produce xhtml markup – Can be a real time saver – never have to manually produce Xhtml – the Nhaml view is rendered as full XHTML </li></ul>ViewEngines
    12. 12. <ul><li>UID developers to </li></ul><ul><li>Work alongside technical developers </li></ul><ul><li>No longer create static templates in isolation </li></ul><ul><li>Create fully integrated views to be dropped into a solution </li></ul><ul><li>Create UI tests (Selenium) against those Views </li></ul>I have a dream…
    13. 13. <ul><li>Only ‘Greenfield’ projects will be MVC / WebForms 4.0 </li></ul><ul><li>Still have to deal with existing </li></ul><ul><li>pitfalls for some while yet </li></ul><ul><ul><li>Legacy applications </li></ul></ul><ul><ul><li>EPiServer support for MVC is </li></ul></ul><ul><ul><li>coming – but not this year at least </li></ul></ul>Not so fast
    14. 14. <ul><li>Developing HTML views for ASP.NET applications will get a lot easier and more enjoyable in the very near future ………. </li></ul>Conclusion

    ×