ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

While I have been writing a lot about ASP.NET AJAX and other stuff, I also wanted to keep adding my little nuggets on ASP.NET 2.0 which is one of the favourite platform for Web Development.  While working with ASP.NET 2.0 and Visual Studio 2005, you may not know certain new things which are a part of it and usually go unnoticed.  Atleast I missed them and after a year, completing a big application realized that it would have been great if I had used these features.

So, here it is, 10 things you might not know about ASP.NET 2.0

No need to press "Ctrl + Shift + B" (Build) for everything

When working with ASP.NET 2.0 and Visual Studio 2005, you dont need to press Ctrl + Shift + B (in other words build) to check every change you make to the source / design.  Both the ASPX Page and Code behind files are compiled dynamically when you run the page and if there is a change, the source / design is recompiled accordingly so you dont have to rebuild the solution.  In fact the only instance where you want to rebuild the solution is when you add an external DLL reference / modify and add an external DLL again, where I have found some cases when the change is not reflected.

This would save a lot of time particularly in big projects where you have lot of source files and building all of them for each and every change would consume lot of time.

Data Source doesnt always need to be SQL DataSource

When working with Data Sources most of us would have seen the SQL Data Source examples and always said "Ah, this is good for Demo but what about enterprise applications where I cannot have the SQL Query or Stored Procedure mentioned in the Data Source definition in the ASPX Page"  Object Data Source accepts your business layer methods as inputs and very well acts as a bridge between your business layer.

http://msdn.microsoft.com/msdnmag/issues/05/01/DataPoints/#S5

Web.Config is more friendly to IIS

Web.Config is one of the favourite things and the toughest nuts to crack in terms of editing them.  While most of us might have seen Web.Config edited using the Website Administration Tool (if it sounds like alien to you or have never tried out, go to "Website - ASP.NET Configuration" in Visual Studio 2005), little is known that you can edit the Web.Config settings using IIS - yes Internet Information Services.

When you install ASP.NET 2.0 (gets installed when you install Visual Studio 2005 as in most of the cases), you get the "ASP.NET" Tab for virtual directory properties and that provides you a whole bunch of utilites like version management as well as Configuration management wherein you edit the Web.Config properties, very handy for deployment scenarios where you dont have Visual Studio 2005 and hence no Website Administration Tool.

http://geekswithblogs.net/ranganh/archive/2006/02/23/70461.aspx

Client Script Call Back allows you to AJAXify your page

While the whole world is running behind installing AJAX Toolkits including ASP.NET AJAX, ASP.NET 2.0 had this little nice feature called "Client Script Callback Manager" which allows you to make asynchronous calls to your server side methods and hence enabling partial page update or remote scripting or AJAX enabled, whatever way you like to call it.  For more information check out http://msdn.microsoft.com/msdnmag/issues/04/08/cuttingedge/

TreeView - You always wanted, now it is here

While a TreeView is such a popular control required, it was always missing in the earlier versions of ASP.NET.  Users have to resort to using the less extensible "IE Webcontrols" or run behind third party solutions. ASP.NET 2.0 comes with a built-in TreeView control which is tested and works fine across Firefox, etc., and also provides properties and methods including On Demand (again AJAX Feature) loading of child nodes.  Check my own blog's ASP.NET 2.0 Category articles for a few posts on TreeView

http://geekswithblogs.net/ranganh/archive/2006/03/25/73300.aspx

MultiView - Finally there is a Tab Control

As much as TreeView is important, a Tabbed Control was always required to show different portions of page in the same page.  The MultiView provides you a tabbed interface for showing different sections of your page within the same page, on demand.  It is a cool utility to provide Tabbed interface to your pages. 

http://geekswithblogs.net/ranganh/archive/2005/12/16/63300.aspx

Subsitution Control

Whenever you Cache enable your page, all portions of your page become more or less static until the Cache gets invalidated.  However, if you have a little nifty section of your page (Cricket Score? eh ? ) that needs to always retrieve fresh data, dont blame Cache and remove it from the whole page.  Use the substitution control which can help you in making a portion of your page dynamic using the method you provide to use for constant update.

http://geekswithblogs.net/ranganh/archive/2005/05/04/39003.aspx

PreviousPage - How I wonder what was there (in the previous page)

Dealing with web applications is such a nuisance considering that it is state less and we need to preserve values across postback.  Session has been beaten to death though its still a good way.  But what if I want to retrieve the TextBox value of the previous page, use the Page.PreviousPage property to retrieve the control's reference and get the value of the TextBox.  Of course this works only if you were in the previous page before coming to this page, but that can be checked and validated.

http://geekswithblogs.net/ranganh/archive/2005/04/25/37633.aspx

Default Button - Hit Enter Key and get what you want it to do

Enter Key has always been challenging in form submission and if you have multiple buttons in your page, you never know which one is firing when user hits enter.  I have seen sites till date which allow me to enter registration information and when I press "Enter" to complete take me to the "Search" Page since it is the first button on the top of the page.  With ASP.NET 2.0, the Default Button is a property that can be set at the Form level / panel level to specify which button should be fired when the user hits the "Enter" Key and accordingly act.  Its a cool utility which provides complete control of where you want to fire an event upon user hitting the "Enter" button.

http://geekswithblogs.net/ranganh/archive/2006/04/12/74951.aspx

You are already writing a Mobile Applicaiton

In ASP.NET 1.x versions you had to use the MMIT (Microsoft Mobile Internet Toolkit) for writing pages that can be rendered on Mobile Devices.  However, with ASP.NET 2.0 your pages that run on the browser, automatically run on mobile devices since the rendering capabilities and the user agent is automatically determined before the page is rendered.  So, your ASP.NET 2.0 Page can also be viewed over devices, without additional effort from you.

I think I tried to provide 10 things you might not know about ASP.NET 2.0 and that is the reason, I have avoided mentioning things like GridView, MasterPages, Themes etc., which have been dealt with for a long time now.

Many of these are little things which can help with your web development and if you have issues with these, we would like to hear your development experiences, so please post them in your comments.

Cheers !!! 

Print | posted on Monday, July 30, 2007 2:37 AM

Comments on this post

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
Hey thanks, those are some good pointers. There were a few I was unaware of.
Left by Justin on Jul 30, 2007 4:04 AM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
This is interesting.
Left by dotnetuncle - .NET Interviews on Aug 01, 2007 11:39 PM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
Is there any way to know if ASP.net 2.0 or higher can be used on a server ???
Left by cslamsg on Jul 24, 2008 4:41 PM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
Hi! Thanks for listing all these interesting things about ASP.NET in general. I, for one was unaware of them. However, I just wanted to point out one thing about ASP.NET cache. Due to its in-progress and standalone nature, it is not terribly scalable. Distributed caching is one concept every modern developer should be familiar with in order to built robust and scalable ASP.NET apps.
Left by Edmartinez on Nov 19, 2008 3:37 PM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
it was really guuuuuuud
Left by ranjan on Apr 16, 2009 4:33 PM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
Really a helping material
Left by Mack on Jul 31, 2009 2:00 AM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
veryy good



Left by meksika biberi zayıflama hapı on May 31, 2010 11:59 PM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
Tenakary onnu krishnan, maja bhukh lagli.
Left by HI on Dec 25, 2010 10:19 AM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
Intersting! I make only the first steps in programming. I need to know it for my job. I'm an IT controller and to ASP.NETmy job well I have to learn to read and make up logarithms.
Left by Handbags on Feb 06, 2011 3:33 AM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
The importance of providing opportunities for men, including tuition reimbursement, is frequently underestimated as allfreepapers.blogspot.com student papers said
Left by Tithus on Jun 22, 2012 3:40 PM

# re: ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0

Requesting Gravatar...
A law clerk has to do work under the direction of a lawyer in preparing and filing cases in the court. The nature of the work requires proficiency in the legal matters and understanding of the legal terms and language used in the court documents. Hence a law clerk certification is necessary to enter into the field. Academy of Learning College (AOLC) provides the best opportunity to gain knowledge, practical experience and an accredited certificate to work as a law clerk.
Left by Allen on Nov 07, 2013 3:42 PM

Your comment:

 (will show your gravatar)