A First Look into Atlas
page 8 of 12
by Mohammad Azam
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 45902/ 58

Adding an Update Panel Control

The next task is to add an UpdatePanel Control to the page.  The UpdatePanel Control is responsible for converting the server postback to the client side postback.  Any control placed inside the UpdatePanel Control automatically uses the client postback.  In other words, all you need to do is add an UpdatePanel to the page and place the GridView inside the UpdatePanel.  Take a look at the code below.

Listing 3 – GridView inside the Update Panel control

<atlas:UpdatePanel ID="up1" runat="server">             
<ContentTemplate> 
<asp:GridView ID="gvContacts" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="White"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"CellPadding="4"
DataSourceID="SqlDataSource1"ForeColor="Black" GridLines="Vertical" >
<FooterStyle BackColor="#CCCC99"/>
<Columns>
<asp:CommandFieldShowSelectButton="True" />
<asp:BoundField DataField="Name"HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Address"HeaderText="Address"
SortExpression="Address" />
</Columns>
<RowStyle BackColor="#F7F7DE" />
<SelectedRowStyle BackColor="#CE5D5A"Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#F7F7DE"ForeColor="Black" HorizontalAlign="Right" />
<HeaderStyle BackColor="#6B696B"Font-Bold="True" ForeColor="White" />
<AlternatingRowStyleBackColor="White" />
</asp:GridView>
</ContentTemplate>  
</atlas:UpdatePanel> 

Analysis

The UpdatePanel Control is the part of the Atlas framework.  I moved the GridView inside the Update Panel’s ContentTemplate tag.  Now if you run your application, you will notice that all the events generated by the GridView are handled on the client side and no server postback occurs.


View Entire Article

User Comments

Title: 100%   
Name: nitin khadloya
Date: 2007-07-18 8:46:49 AM
Comment:
it's very useful gor beginners
Title: I rate you 10/10 : Very Good   
Name: Irfan
Date: 2006-12-22 5:06:09 AM
Comment:
Great Explaination !!

This article gives a great confidence to beginners

keep it up...
Title: Cool Article   
Name: Hemendra Singh Shaktawat
Date: 2006-09-11 3:57:00 PM
Comment:
Hi,

Thanks for nice article, would really help people new to Atlas like me :)

Thanks and best wishes

Hemendra Singh Shaktawat

Mindifire Solutions
www.mindfiresolutions.com
Title: Atlas   
Name: Mr Atlas
Date: 2006-09-11 10:57:25 AM
Comment:
Atlas makes me crazy, man!
Title: Great Tutorial   
Name: Budi Irawan
Date: 2006-08-15 3:25:33 AM
Comment:
it is a great tutorial about partial update with atlas. I have played a little bit with ajax in Ruby on Rails and now I also can find same feature in Atlas.

Many thanks
Title: Atlas   
Name: vijay kumar
Date: 2006-07-04 9:46:52 AM
Comment:
Great Article. I am new to atlas. I got lots of confidence after going through this article. thank u.
Title: Atlas make developing ajax application faster   
Name: steve
Date: 2006-06-10 7:03:03 AM
Comment:
Good articles. Ajax make developer life easier. It takes a very less amount of work to create ajax website.
A new Community website has been created : http://www.AtlasASP.com/
Title: UpdatePanel has no effect on the GridView itself   
Name: Wim
Date: 2006-05-19 5:38:34 PM
Comment:
Mohammad wrote "I moved the GridView inside the Update Panel’s ContentTemplate tag. Now if you run your application, you will notice that all the events generated by the GridView are handled on the client side and no server postback occurs." What events are meant here? The GridView works as normal, except that only the GridView will have roundtrips to the server, not the whole page. But that doesn't make much difference in the current example.

Mohammad's example is a read-only list, but if you use de GridView to change records then you need different templates. In this case I would have liked that the statement of Mohammad was true. That the change from the ItemTemplate to EditItemTemplate was handled by client-side script, instead of by the server.

Concerning sorting, without templates you can use EnableSortingAndPagingCallbacks, already an Atlas-like feature of .NET 2.0.
Title: Atlas makes the difference !!   
Name: Guest
Date: 2006-05-10 11:42:14 PM
Comment:
Looks like Atlas makes Web developers and users life simple. I believe it must have some disadvantages too. It would be good to provide a little section about this as well along with any Atlas functionality shown. This would give the developer edge of whether or not implement it depending on the context.
Title: atlas   
Name: mike
Date: 2006-05-10 2:26:53 AM
Comment:
Great Article, How can i instal the atlas controls into my visual studio tool box under standard catagory.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-28 8:14:57 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search