Technology Challenges in Building New Media Applications
ASP.NET and HTML 5 - Will this combination Work?
1. ASP.NET and HTML 5- Will this combination Work?
HTML5 has introduced the world to the gen-next web, enabling the addition of new and interesting
aspects to the web. While some consider it as just something that consists of new markup attributes, some
others consider it as a huge revolution that consists of more than 100 specifications that relate to the next
generation of Web technologies. The W3C has addressed the scope of what’s changing on the Web by
introducing HTML5 as a unifying concept for that change.
ASP to ASP.net migration came as a major change. ASP.NET was Microsoft's first attempt to enable
Microsoft development with the ease and efficiency of the.NET desktop development environment.
However, its failure to satisfactorily maintain session state prevented it from realizing the simple visual
desktop development methodology.
When Microsoft announced that HTML5 and JavaScript would be the first-class tools for creating
'Windows 8' applications, most .NET development experts were worried regarding their investments in
XAML and Silverlight being wasted. These apprehensions were soon put to rest when they learned that
the technologies bundled under the HTML5 banner are great for client-side development. Also, those
technologies can be repurposed to be used in desktop and smartphone development. Moreover, HTML5-
related technologies provide direct support for features that developers take for granted in other
environments.
HTML5 provides great support to ASP.NET web-forms. Here’s why the ASP.Net and HTML5
combination will work well.
HTML5 elements are defined as markup with a client-side event model and there's no
requirement on the server. Also, the HTML elements and attributes emitted by ASP.NET
server controls are well formed and validated against the HTML5 specification.
Developers who want built-in server controls in order to leverage the new aspects of HTML5 like
semantic elements can do so using custom controls or content adapters.
In order to omit specific HTML5 elements, Render method of the UserControl class can
be used.
ASP.NET 2.0. has introduced another mechanism of supporting HTML5 elements
through content adapters. Content adapters are powerful tools that allow you to specify
how specific controls should emit markup.
The input elements in HTML5 have far more states (text, password). In addition to the already
existing states, HTML5 adds number, datetime, email, url and a half-dozen more. The new
required attribute prevents a page from being submitted until the element is provided a value.
While working with numeric fields, the step, max and min attributes provide further declarative
control over the user's data entry; on text fields, the pattern attribute allows you to apply a regular
expression to the user's input. If a prompt string needs to be displayed in a text box, the new
placeholder attribute can be added and set to the string to be displayed.
2. Earlier, developers used div and span tags as structural elements to define sections of a page that
were to be styled or managed as a group. HTML5 includes new tags that acknowledge the typical
grouping that developers use in pages: That pages usually have headers, footers and navigation
sectors in addition to their primary content. The section tag allows you to divide your page into
sections, containing articles (the page's primary content) and asides (content that isn't a critical
part of the page).
ASP.NET developers need to be well-versed with HTML5 features since all of the leading browsers are
aggressively supporting them and newer web applications are bound to be relying heavily on them. Using
Microsoft ASP.NET 4.5 and Visual Studio 2012 makes building web applications using HTML 5,
EcmaScript 5 and CSS 3 easier than ever.