Ayman Farouk

Microsoft Maniac Guy ..!
posts - 33, comments - 66, trackbacks - 59

My Links

News

Archives

Blogroll

Links

Atlas UpdatePanel Control

I was about to blog something about the Atlas UpdatePanel control, then, I saw a new reply to this post  “UpdatePanel Question  “ in asp.net forums. So, I decided to post a small thing about using the UpdatePanel control with GridView & DataSource control.

Note: If you still do not know what Atlas is, I advice you to visit this link and download the December bits.

UpdatePanel control is one of the most interesting Atlas server controls, I think it's gonna be “the most common” control. Because it's able to support most of the functionalities you may need in your webpage.

This control allows you to do a “postback” for a specific part of the page. In fact, it simulates a postback rather than doing a real one. The first thing we have to do in order to use this control, is to enable Partial Rendering which is one of the Atlas ScriptManager control properities. And thats so easy, it just goes like this

<atlas:ScriptManager ID="ScripManager" runat="server" EnablePartialRendering="true"> </atlas:ScriptManager>

Now, we can start working with our UpdatePanel.

<atlas:UpdatePanel ID="myPanel" runat="server">

           <ContentTemplate>

           </ContentTemplate>     

           <Triggers>

                     <atlas:ControlEventTrigger />

                      <atlas:ControlValueTrigger />

            </Triggers>

</atlas:UpdatePanel>

This is the standard form of the UpdatePanel,  I just placed an UpdatePanel control I called it “myPanel”. Now I'll tell you about the tags.

  • The ContentTemplate tags are clear enough to be understood, between these two tags <ContentTemplate> </ContentTemplateyou can place what you want of controls such as <asp:TextBox .. /> <asp:GridView .. /> etc.
  • Between the <Triggers> </Triggers> you can specify when this UpdatePanel will be “posted back“, and this specification can be done in two ways 1- On some control event. 2- On some control value changing; and thats why the two tags  <atlas:ControlEventTrigger /> and  <atlas:ControlValueTrigger /> are here. So, if you want to let this panel get updated on a button_click you can just add a single line of code like : <atlas:ControlEventTrigger ControlID="Button" EventName="Click" /> . I think the intellisense will help you in doing this :-)

Okay, lets see how can we fetch “filtered” data from a Datasource , and show it in a GridView control.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="UP.aspx.vb" Inherits="UP" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

Protected Sub myLButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)

        AccessDataSource1.SelectCommand = "SELECT [FirstName], [LastName], [Title], [City] FROM [Employees] WHERE ([FirstName] = ?)"

         myGV.DataSource = AccessDataSource1

         myGV.DataBind()

End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >

  <head runat="server">

     <title>UpdatePanel Example</title>

      <atlas:ScriptManager runat="server" ID="ScriptManager" EnablePartialRendering="true"></atlas:ScriptManager>

  </head>

  <body>

     <form id="form1" runat="server">

     <div>

     <asp:TextBox runat="server" ID="myTBox"></asp:TextBox><asp:LinkButton runat="server" ID="myLButton" OnClick="myLButton_Click">Submit</asp:LinkButton><atlas:UpdatePanel ID="myPanel" runat="server">

    <ContentTemplate>

         <asp:GridView runat="server" ID="myGV"  > </asp:GridView>

    </ContentTemplate>

   <Triggers>

       <atlas:ControlEventTrigger ControlID="myLButton" EventName="Click" />

   </Triggers>

</atlas:UpdatePanel>

     <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" >

            <SelectParameters>

                <asp:ControlParameter ControlID="myTBox" Name="FirstName" PropertyName="Text" Type="String" />

             </SelectParameters>

    </asp:AccessDataSource>

    </div>

    </form>

  </body>

</html>

Okay, the above page has an UpdatePanel, TextBox, LinkButton, AccessDataSource and a GridView. We want to get some information about an Employee his/her First Name is entered in the TextBox, but we wanna perform this without a page “refresh”, thus we used the UpdatePanel control and we located the GridView in it. Now, the Data will be changed everytime then Button clicked. Thus we used the <atlas:ControlEventTrigger /> tag.

Back to the forums post; In the post I linked to. The problem was that the DataSource is not accessible if it's not located in the UpdatePanel, and I tried this before and I said yes. But I think I was mistaken, cause lately, I found that things are working okay even if the DataSource control is located out of the UpdatePanel.

One more thing I want to tell you about, is that you can configure your UpdatePanel control using some easy GUI forms. I think, they're helpfull in making triggers.

What I wrote above, was a small thing about the UpdatePanel  control, hope this post helps in making this control more familiar, I also hope it's not “boring post” ..

A.

Print | posted on Saturday, February 04, 2006 9:50 PM |

Feedback

Gravatar

# re: Atlas UpdatePanel Control

Hi,
That is helpful post. There are manythings in VS2005 and sometime mixup and confusing if you try to learn fast. One more thing if you post on you blog.

Simple example about

1- How we drag and drop webparts without page refresh or postback or Minimize or Restore webpart without postback.

I will vist again to if see if you post anything useful

Thanks
2/5/2006 7:22 AM | P_Programmer
Gravatar

# re: Atlas UpdatePanel Control

I think near your linkbutton, you are missing an opeing UpdatePanel tag. Nice article BTW.
3/1/2006 11:24 PM | Peter Kellner
Gravatar

# re: Atlas UpdatePanel Control

Hello Peter, no am not missing an openning tag but it is lying on the same line of LINK BUTTON. Thanks :)
3/2/2006 1:37 PM | Ayman Farouk
Gravatar

# re: Atlas UpdatePanel Control

Erick Maybe you should use propertyName="SelectedItem" instead of a value.
7/22/2006 12:04 PM | Horixon
Gravatar

# re: Atlas UpdatePanel Control

Erick, I have found that the in the ControlEventTrigger, the EventName is case-sensitive. Perhaps it is the same for the ControlValueTrigger tag.

Try this:
<atlas:ControlValueTrigger ControlID="textbox1" PropertyName="Text" />

7/24/2006 3:13 PM | Ziko
Gravatar

# re: Atlas UpdatePanel Control

Someone knows how to create dynamically an updatepanel.?
i cant put a content template.
dim up as new updatepanel
upUpdate.Controls.Add(outerTable)
10/13/2006 4:37 PM | Kallaz
Gravatar

# re: Atlas UpdatePanel Control

A perfectly interesting post thank you.
10/25/2006 8:37 AM | lisa
Gravatar

# re: Atlas UpdatePanel Control

Thanks!! Excellent post...
2/20/2007 12:18 PM | Manoj
Gravatar

# re: Atlas UpdatePanel Control

Hello all there,

I am facing a problem with update panel...
when my content get updated during postback.....i need to make it hide and want o show only progess icon in place of contents...

and as the content get updated, progess bar should get invisible and the updated content should be display on page...

I am able to achieve this task....


Can anyone here help me to rid out this issue....

many thaks in advance.......

regards,
Abhishek



9/12/2007 5:19 AM | Abhishek Jain
Gravatar

# re: Atlas UpdatePanel Control

nice article
5/12/2008 4:27 AM | Ajit Singh,Noida/9899488392
Gravatar

# re: Atlas UpdatePanel Control

Hi,
this is really good solve.This helped me to do with update panel in atlas.
Great job.......
10/14/2008 4:27 AM | Maloy Adhikari
Gravatar

# re: Atlas UpdatePanel Control

yes,the shox shoes is running shoes ,durable and fashion.The Beloveshox onine store sale cheap but real quality .And promise the more you buy ,the more discount you have.welcome you to choose.
8/24/2009 11:08 AM | leo
Gravatar

# <p><a href="http://www.beautyjordan.com/mens-nike-air-jordan-18-shoes-c-495.html"><strong>www.beautyjordan.com store,</strong></

<p>www.beautyjordan.com store,al l jordan shoes are very comfort and fashion. come on and choose what you like</p>
Gravatar

# re: Atlas UpdatePanel Control

Would you like to be cool on your foot? Come here, the jordan shoesgive you the super feeling!
9/4/2009 2:04 AM | beautyjordan
Gravatar

# re: Atlas UpdatePanel Control

www.beautyjordan.com All Jordan shoes are made of high quality raw materials and low price. There are fashionable designs and various colors.
9/4/2009 2:05 AM | beauty
Gravatar

# re: Atlas UpdatePanel Control

Thank you for your sharing! It's great!http://www.beautyjordan.com
9/4/2009 2:07 AM | beauty
Gravatar

# re: Atlas UpdatePanel Control

our puma shoes is original
and you can order from us
for the original gucci shoes and puma sneakers
welcome to post the order and order from our company
we are honest supplier in the world!
pls come to our shop and pick the puma shoes for you
it is the world famous shoes you will like
http://www.puma2u.com/

9/20/2009 10:02 AM | lili
Gravatar

# re: Atlas UpdatePanel Control

Ugg boots (sometimes referred to as uggs or ug boots) are a style of sheepskin boot, with wool as the inner lining and a tanned outer surface worn by both men and women. Ugg boots often have a synthetic sole, although this is not universal. Uggs have been identified as a fashion trend for men and women since the early 2000s. In late 2008, Ugg boots grew again in popularity with men as male celebrities were seen in them.
http://www.llikeonline.com

9/20/2009 10:03 AM | lili
Gravatar

# PUMA Shoes high quality with preference price ! http://www.puma2u.com/

PUMA Shoes
high quality with preference price !
http://www.puma2u.com/
9/27/2009 10:06 PM | lulu
Gravatar

# Ugg boots

Ugg boots on sale http://www.llikeonline.com
9/27/2009 10:09 PM | lili
Gravatar

# PUMA Shoes high quality with preference price ! http://www.puma2u.com/

our puma shoes is original
and you can order from us
for the original gucci shoes and puma sneakers
welcome to post the order and order from our company

http://www.puma2u.com/

9/28/2009 9:56 PM | LIULI
Gravatar

# Ugg boots on sale http://www.llikeonline.com

Ugg boots are a style of sheepskin boot, with wool as the inner lining and a tanned outer surface worn by both men and women. Ugg boots often have a synthetic sole, although this is not universal. http://www.llikeonline.com
9/28/2009 10:10 PM | lili
Gravatar

# hh

Welcome to our website:http://www.llikeonline.com.

Find cheap uggs and buy Cheap Ugg Boots online is your best choice. We can provide Fashion design and High quality UGG boots,ugg sandals,ugg shoes cheap for people of all ages ,UGG for men, ugg for women,ugg for kids, authentic UGGs.
exclusive ugg boots store, Always with pleasure at your service.

Payment method: Western Union, IPS,GSPAY
Delivery by EMS in 6-9 business days
9/29/2009 7:20 AM | xx
Gravatar

# PUMA Shoes high quality with preference price ! http://www.puma2u.com/

PUMA Shoes

http://www.puma2u.com/
9/29/2009 10:07 PM | lulu
Gravatar

# re: Atlas UpdatePanel Control

sell Aion cd key
10/12/2009 10:34 PM | sell Aion cd key
Gravatar

# re: Atlas UpdatePanel Control

maple story meso
10/12/2009 10:36 PM | maple story meso
Gravatar

# re: Atlas UpdatePanel Control

cheap metin2 yang
10/12/2009 10:37 PM | cheap metin2 yang
Gravatar

# Nearly 11,000 mainland tourists travel to Taiwan during National Day holiday

cheap metin2fd
10/13/2009 12:51 AM | yanjia
Gravatar

# re: Atlas UpdatePanel Control

I ordered chocolates hoping they wouldn't show marks as much as my beige uggs on sale and waterproofed them when I first got them. They look so much cleaner than my old beige pair, I wear my Whooga's all year round, they don't make my feet sweat as much as my older pair. I'm very impressed with how they are holding up to my abuse, very well made. My only suggestion to everyone is keep them dry and out of the mud

Wow, my ugg boots will not be coming off now! I’ve had them on for 12hrs strait and I do not want to take them off. Thanks for everything, well worth the wait.
10/26/2009 12:58 AM | uggs
Gravatar

# UGG

<p>Women's ugg bailey button as well as the Classic Short,is a calf-height boot made from genuine twin-face sheepskin.With a wooden UGG logo button and elastic band closure. The ugg bailey button sheepskin can either be worn up or cuffed down adding a little variety depending on your style.All boots in our Classic Collection feature a soft foam insole covered with genuine sheepskin and have a molded EVA light and flexible outsole designed for amazing comfort with every step.</p>
11/5/2009 1:32 AM | Matt
Gravatar

# re: Atlas UpdatePanel Control

Very good transaction. ugg mayfaire bootsare exactly

what my daughter wears. Wonderful!!
11/17/2009 1:58 AM | wqerewtwet
Gravatar

# <p>Nice! I like! My <a href="http://www.buddyugg.com/"><strong>ugg classic cardy</strong></a> arrived today, I'm very pleased w

<p>Nice! I like! My ugg classic cardy arrived today, I'm very pleased with them. So silky smooth and soft I can't believe it. I researched the whole ugg thing last year but decided not to order because I really couldn't afford a pair. This year I read about Whooga's in a fashion forum and decided to give them a try. I ordered a size too small initially and had to return them for a 6 which was a bit annoying but eventually worth the wait, I'm a 5.5 in most shoes but uggs boots on sale sometimes vary between 5.5 and 6. I probably should have measured my foot, anyway I'm very pleased..</p>
11/22/2009 6:37 PM | <p>Nice! I like! My <a href="htt
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: