Things to Look at in ASP.NET 2.0
By Jinath Premaratne MCP
Published: 5/5/2005
Reader Level: Beginner
Rated: 2.75 by 12 member(s).
Tell a Friend
Rate this Article
Printable Version
Discuss in the Forums

The goal of this article is to illustrate some of the new feature in ASP.NET 2. This article is base on beta 1 release of asp.net 2.

Over the past years we all talked about asp.net 1 /1.1, and how the programmer's life got changed. Well talking about asp.net 2 it is a revolution. There are so many things to talk about, from simple login control to role management. In this article, I will jest go through some the new revolutionary futures. So get ready for the fun.

Productivity

Talking about the developer productivity, Microsoft says that in ASP.NET version 2 there are 70% less coding than in asp.net 1.1. One of the prime example that comes to mind when talking about this is the new GridView control. It has built in capabilities to apply paging, sorting and editing. After you carte a Data Source Object and assign to grid view control (which I will explain more later), you only need small changes to do in the property box or in html code to enable paging and sorting. That's it, no code need, asp.net will do the paging and sorting for you. Here how the html looks like.

<asp:GridView ID='GridView1' Runat='server' DataSourceID='SqlDataSource1' AutoGenerateColumns='False' AllowPaging='True' PageSize='5' AllowSorting='True'>


Performance

Thinking about Performance, ASP.NET 2 has included new caching capabilities Intergrated with Microsoft SQL server, called SQL cache invalidation. You can now create cache dependencies for Sql tables. With Sql cache invalidation, when a table changes, ASP.NET will get the latest date from the SQL server, regardless of output cache duration.

Also now asp.net 2 provides 64-bit support.ASP.NET application will run on 64-bit Intel or AMD processors. Also ASP.NET 2 is backward compatible with ASP.NET 1/1.1. You can recompile an ASP.NET 1/1.1 application on top of the .Net framework 2.0.

Mobile Controls?

The next feature I'm going talk is really grate. ASP.NET 2 now has the capability of determine the output target. What I'm saying is, once you carte a web page, it will run from internet browser to mobile phone. <asp:> tags will do all the rending. No need to use separate <mobile:> tags. ASP.NET server controls now can render from HTML to WML.

User login

One of the common things in developing web based applications is to add security and role management. We used to create login forms and data base tables to handle role based security over the years, in asp.net 2 you don't need to crate login forms. Its build in as a web control and has new APIs to handle user membership and role management. And to store users and roles asp.net use MS access as default data base, but also it supports SQL server and active directory. Not only these, actually it supports anything, you can create your user storage in oracle if you prefer.

Personalization

Personalization is another cool feature in ASP.NET 2. It has the capability of personalize an application and store the personalize settings. That means application can customize color, style, font and ext according to the login user's preferences. Using personalization APIs with Membership and role management APIs which I talked earlier, you can make really customizable applications.

Portal Frameworks and Web Parts

Talking simply, Portal Frameworks and web parts are page customization done by end users. Web parts are object in the portal framework, end users can open, close, minimize, maximize or move from one part to another. Portal frame work enables to build pages that contain web parts. There are new set of controls available in asp.net 2. Web part manager (portal framework manager control), Web parts zones, and catalog zone to name few. A good example is the admin section of MSN space.In there you can change positions, Add or can Close you web parts.

Master Pages

Master pages are all about visual inheritances. Web sites normally have same header, menu and footer for all its pages. Earlier developers have to include this sort of common things every time when they create a page, as a web user control or in old asp world as a include page. But now once you create a master page, you can tell asp.net to include that page as a master page to the new pages.



Administration and Management

Web site administrator's life now getting easier with asp.net 2 includes a Microsoft Management Console (MMC) snap-in to administrate web sites. Administrators can now edit machine.config and web.config from this.

Also ASP.Net 2 includes web administration tool which runs in web browser. From this, administrators can add users , add security like a roles , Create/Manage access rules, Configure debugging and tracing, Get site counter reports, Configure SMTP e-mail settings and can do much more.


New Server controls

Asp.net 2 will come with new set of server controls.
° Gridview as I talked early this is a new control to display data with enhances features.
° Set of controls call Data Source Object which will handle the database work like connections, retrieving data, manipulating data, sorting, paging, editing and all the stuff.
° Another set of controls to call login controls to handle user authentication and user management.
° Web parts controls for you to use in when creating web parts.
° XML base site navigate control and menu control for site navigation
° Tree view control
° And more
And also there some changes happen to the asp.net 1.0 server controls. One cool thing I have to point out is now from Button, LinkButton and ImageButton server controls you can easily call client side scripts using OnClientClick property .here is a small example.

<script language="javascript"> function print(){ alert("No More Tsunami"); } </script> <asp:ButtonID = "Button1" Runat = "server" OnClientClick = "javascript:print()" Text ="Button" />
Life getting easier isn't it?

Handling Data

In asp.net 1\1.1 if you need to show data from a data source, you had to go through some steps, for an example if you want display data from MS SQL server you need to create set of objects, first you had to create a sqlconnection object, then create a data adapter with the select command, create a data set , afterwards fill the data set with the adapter, then give data set as the Data Source of the data grid and bind It.

As I mention earlier, in ASP.NET 2 there are set of new data access controls. It is very easy to use these controls and manipulate data. Actually you don't need to write any line of coed apart from putting some HTML tags. WHAT!

To display data from SQL server to grid view control, what we have to do is only write this in HTML.

<asp:GridView ID="GridView1" Runat="server" DataSourceID="SqlDataSource1" AllowSorting="true">
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" Runat="server" SelectCommand="SELECT * FROM [Students]" ProviderName="System.Data.SqlClient"< br>ConnectionString="Server=.;;Database=CDNUG;Persist Security Info=True">
</asp:SqlDataSource>

What I have done is , create a grid View control and gave the DataSourceID as 'SqlDataSource1', which is the ID of my SqlDataSource. And for the SqlDataSource I have given the values for the properties ID, SelectCommand, ProviderName and ConnectionString.Well that's it. after that you will get a page with a Grid View control containing data. Apart from SqlDataSource asp.net have AccessDataSource, ObjectDataSource, DataSetDataSource and SiteMapDataSource, also you can create your own data Source object.

Visual studio 2005

Asp.net 2 will support the new IDE Visual studio 2005 which has some new advance features which will integrate with ASP.NET's new enhancements. One off main advantage in Visual Studio 2005 is, you don't have to install IIS in the developer machine, it has a built-in web server to run and debug web applications, and of cause another set of articles will need to talk about visual studio 2005.

Conclusion

With the new and improved features of the Asp.Net 2 and its integration with Visual studio 2005, asp.net 2 will become a key technology in web development world. Adding to these new things, the new language enhancements for Visual basic 8.0 and c# 2.0 will rock. Introduction of Generics and partial classes for both VB 8 and c# 2 and new anonymous methods iterators for c# will get programmers life easy. So look up for a world of new features. This article was jest an overview, I will be writing more in dept articles about the asp.net 2 features. I wrote only some of the key asp.net 2 features, there are lots more to point out.



Marketplace
(Sponsored Links)
What are the green links?
   



 
Copyright © 2007 CMP Tech LLC |
Privacy Policy (4/10/06) | Your California Privacy Rights (4/10/06) | Terms of Service | Advertising Info | About Us | Help