Asp.Net 4.0

Wednesday, 19 October 2011

Asp.Net 4.0

1) significant enhancements to ASP.NET that provides more control over HTML, element IDs and custom CSS that make it much
easier to create standards-compliant and SEO-friendly web forms.

2)ASP.NET 4.0 application provides support to websites as well as web application projects.
The default ASP.NET application provides a good starter project template with some common items which have to be built
for almost all web based projects like a Master Page with a standard template, About us page, Login page, Register page,
Change Password page, a default style sheet named Site
Chart Control

    * Point
    * FastPoint
    * Bubble
    * Line
    * Column
    * Stacked Column
    * Pie
    * Pyramid
    * Etc.,

4)But .NET developers no longer find themselves in such situation because in ASP.NET 4.0 there is a
property called ClientIDMode for all the controls. This has provided good control over the ID generated for
the content controls during runtime.

The types of ClientIDModes available are:

   1. AutoID - This is the same random way as it uses to happen in the earlier versions of ASP.NET.
   2. Static - The ID of the control will not change at the runtime. This is pretty handy setting if the control is being used in the container or in the child pages and needs to be accessed on the client scripts.
   3. Predictable - For the controls like a textbox in a GridView template column Static mode will not be useful because of the repeating rows of the GridView. In such scenarios Predictable mode comes in handy where the developer can provide a predictable value say a primary key of the GridViewRow using the ClientIDRowSuffix property. This will append the predictable unique value as suffix to the actual control id. For example if the actual control id in the TemplateColumn is txtBox and the ClientIDRowSuffix is the GridViewRowIndex then the generated IDs during runtime for row1 textbox ID will be GridView1_txtBox_1, for row2 it will be GridView1_txtBox_2 and so on.
   4. Inherit - This will inherit the ClientIDMode value from its parent control.

The developers no longer have the trouble of downloading the JQuery library and adding it to the project explicitly because in ASP.NET 4.0 web based applications JQuery is integrated. Developers are now free to use the JQuery, all that needs to be done is simply add the JQuery library reference onto the web page. The JQuery library is a part of the project template by default

Output caching is a mechanism where the rendered web page or web user controls can be stored in an in-memory cache on the web server. This cannot be customized in the previous versions of the ASP.NET. This kind of in-memory cache mechanism would end up in hiking up the worker process memory which adversely puts the load on the web servers.

Cleaner Web.Config and Multi Targeting

n the earlier versions of ASP.NET there was a restriction in the URL length and the query string size of the URL. The maximum length allowed for URLs is 260 characters and the maximum size of Query string allowed is 2 KB.

In ASP.NET 4.0 the restriction has been lifted off and the control is put into the developer's hands. In the web.config file for the httpRuntime tag there is a couple of new attributes called maxUrlLength to customize the URL length and maxQueryStringLength to customize the size of the QueryString.

Below is the configuration entry which would hike up the URL maximum length to 520 characters and QueryString size to 4KB.

<httpRuntime maxQueryStringLength="4096" maxUrlLength="520"/>

No comments:

Post a Comment