Microsoft has just released .NET 4 Framework together with ASP.NET 4 and Visual Studio 2010 final version to public. ASP.NET 4 and Visual Studio 4 contains lots of improvement, and new functionality that can help and ease programmers in building faster and better applications.
Below are some of the improvements from . NET 4 Framework and Visual Studio 2010 compare previous version .NET 3.5 Framework and Visual Studio 2008
- Clean Web Config Files
- Starter Project Templates
- Multi Targeting
- Multiple Monitor Support
- HTMl/ASP.NET/Javascript code snippets
- URL Routing and ASP.NET 4 Web Forms
- Searching and Navigating Code in VS 2010
- Intellisense Improvements
- SEO Improvements with ASP.NET 4.o
- Build in Charting Controls for ASP.NET 4 and Windows Forms
- Cleaner HTML Markup
- Add Reference Dialog Improvements
- JavaScript Intellisense Improvements with VS2010
- WPF 4
I will explain some of the cool new features of ASP.NET 4 in terms of the html output. Lots of developers of ASP.NET have a hard time on writing Javascript to reference the ASP.NET Web Forms elements because ASP.NET normally output the form elements in the format of ctl00_ContentPlaceholder1_ListView1_ctrl0_Label1. This makes increment in terms of page size and harder to style the elements using CSS or programming using JavaScript.
ASP.NET 4 allow us to have a full control on the ID being generated to the client
New ClientIDMode Property on Controls
ASP.NET 4 supports a new ClientIDMode property on the Control base class. The ClientIDMode property indicates how controls should generate client ID values when they render. The ClientIDMode property supports four possible values:
- AutoID—Renders the output as in .NET 3.5 (auto-generated IDs which will still render prefixes like ctrl00 for compatibility)
- Predictable (Default)— Trims any “ctl00” ID string and if a list/container control concatenates child ids (example: id=”ParentControl_ChildControl”)
- 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”)
- Inherit—Tells the control to defer to the naming behavior mode of the parent container control
The ClientIDMode property can be set directly on individual controls (or within container controls – in which case the controls within them will by default inherit the setting)
Or it can be specified at a page or usercontrol level (using the <%@ Page %> or <%@ Control %> directives) – in which case controls within the pages/usercontrols inherit the setting (and can optionally override it):
Or it can be set within the web.config file of an application – in which case pages within the application inherit the setting (and can optionally override it):
Example of the output files on ASP.NET 3.5 or had ASP.NET 4 application configured to run using 3.5 rendering or ClientIDMode=AutoID
Markup Rendering when using ASP.NET 4 and the ClientIDMode is set to “Predictable”
Markup Rendering when using ASP.NET 4 and the ClientIDMode is set to “Static”
This is just an introduction of ASP.NET 4 new features and improvements. If you need more information, please refer to www.asp.net.
For all developers out there who wants to use this new ASP.NET 4 features, can signup with SeekDotNet Hosting Plans. All SeekDotNet Hosting plans now support .NET 4 Framework and ASP.NET 4 Hosting.