Advertisment

Better ASP.NET 

author-image
PCQ Bureau
New Update

Over the last many months, we've delved into most of the exciting and enhanced features of ASP.NET 2.0. This month's article, which marks the conclusion of this series, summarizes ASP.NET 2.0's additional features, defines some others and



discusses how to increase the speed of Web pages through pre-compilation.

Advertisment

Feature we've discussed



Data source and bound controls:
ASP.NET 2.0 has a new, remodeled method of retrieving data from different sources. The use of new 'Data Source Controls' allow you to connect directly to sources such as any database, XML file, Web service or a business layer object. You do not have to worry about writing a dataset, connections, readers or any other such thing. On the other hand, the 'Data Bound Controls' are visual controls that work with the data source controls and provide the UI for different actions-view, edit, delete, select etc. The older controls such as DataGrid, DataList and DropDown have been upgraded to work like this. However, new controls such as the GridView, DetailsView, TreeView etc. form the powerhouse of the ASP.NET toolbox.

Localization: You can now easily create various language versions of Web applications. The localization features of ASP.NET 2.0 have been improved a lot and let you quickly refer to and use different localized resources within your application quite easily.

Direct Hit!
Applies to:

.NET developers
USP: Increase the speed of your Web pages using pre-compilation in ASP.NET 2.0
Links:

www.asp.net, www.msdn.Microsoft.com/asp.net 
Advertisment

Templates: Creating templatized pages that derive from a common look and feel has become easier. All that a developer now has to do is to create a page, called Master Page, which contains the common elements and look that he wishes to apply across. For all other pages, deriving from this page and supplying the individual content in the appropriate place is enough.



Themes and skins: These customization features extend from a page level setting (Master Pages) to settings for individual controls. Just like the skins that one can apply to applications such as Windows Media Player, you can create skins for individual controls as well. A collection of such skins for different controls can also be applied simultaneously by using a Theme.

Application login: Web-based application creation is fun if you use the new login controls. These controls include the ones for login form, create new user, register user, forgot password etc. Simply dropping them on a form and customizing their properties enable your application to have a full-fledged user management section.

User profiles: You can now manage personal profiles for each user without writing data access code. All you need to use is the Profile object and you can store settings that you wish to keep for your users. This way you don't need to retrieve and store the profile information yourself for providing customized pages.

Advertisment

Additional features



There are numerous features that we have not so far mentioned. Some of them are:

OOB mobile device support: ASP.NET 2.0 controls are built in a way to recognize the type of browser hitting it, meaning thereby that you can now create a single ASP.NET 2.0 application which works with a desktop browser such as IE or Firefox, and also with mobile device browsers such as PocketIE, Blazer, WAP browsers and others without creating a separate Web application for each.

Improved caching: Database caching to increase performance is easier to do in a declarative syntax. You can even control the type of cache expiration policies such as the time and the type.

Advertisment

Web-based events: You can raise and capture action on Web application events that can be used to send e-mail, store information in files/SQL etc.

Pre-compilation



One of the problem with ASP.NET Web application till now was that the first time a user hit the application, the application would be compiled on the fly and the results returned to the user. There was always a small performance hit associated with this every time the application started up.

However, with ASP.NET 2.0, you can pre-compile your application and deploy this to the production Web server. What happens in this case is that the entire source is compiled and the result is only to be uploaded to the production machine. Even the actual HTML/Server control declaration source is removed and included into the binaries.

Advertisment

This makes for a much more secure deployment of your application on a server since no one will be able to see the source. Another benefit is that the user would not face performance delay while waiting for a compilation to occur on the server end.



All this is achieved using the new ASPNET_PCOMPILE.EXE. Simply pass it the path of the folder containing your Web application as well as the output path for the compiled result and wait for the tool to do its job.

Finale



As you can see, ASP.NET 2.0 is a major leap forward in the creation of Web applications. Now Web developers no longer need to be 'code monkeys'-sitting and recreating stuff that has been done a million times before. Instead they can spend their time better architecting their code by using ASP.NET 2.0's new tools along with VS.NET 2005, making it more secure. Here's wishing you all a year for developing better Web applications with ASP.NET 2.0.

Vinod Unny



Enterprise InfoTech

Advertisment