AJAX UpdatePanel triggers, Conditional update mode

First of all I'd like to thank kowalskec for pointing me out the CopySourceasHTML VS add-in that will help me copy the code snippets from Visual Studio here without losing any text formatting.

Cheers buddy! =)

 

And now the task:

  • The BugsGridView GridView control and BugsListTimeLabel Label in the Default.aspx page are encapsulated inside an UpdatePanel with an ID of BugsListUpdatePanel. The UpdatePanel does not update when other UpdatePanels on the page generate postbacks.
  • The ActivityLabel Label control in the Default.aspx page is encapsulated inside an UpdatePanel with an ID of ActivityUpdatePanel. The UpdatePanel does not update when other UpdatePanels on the page generate postbacks. This UpdatePanel does not contain any other controls.
  • The ActivityUpdatePanel UpdatePanel control in the Default.aspx page defines a trigger which causes the UpdatePanel to asynchronously refresh when the Click event of the ClearButton Button is raised.
  • The BugsGridView_RowUpdated event handler in the _Default partial class refreshes the ActivityUpdatePanel UpdatePanel if changes have been made to the BugsGridView GridView control.

This will help me remember how to make the UpdatePanel do a postback by clicking a button outside of the panel, as well as call the UpdatePanel Update() method from code behind.

<!--

Done:

The Default.aspx page contains a ScriptManager control with an ID of

BugsPageScriptManager.

-->

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

<!--

Done:

The BugsGridView GridView control and BugsListTimeLabel Label in the

Default.aspx page are encapsulated inside an UpdatePanel with an ID of

BugsListUpdatePanel. The UpdatePanel does not update when other

UpdatePanels on the page generate postbacks.

-->

<asp:UpdatePanel ID="BugsListUpdatePanel" runat="server" UpdateMode="Conditional">

<ContentTemplate>

Bugs as of:

<asp:Label ID="BugsListTimeLabel" runat="server" Text="" />

<asp:GridView ID="BugsGridView" runat="server" AutoGenerateColumns="False" AutoGenerateEditButton="True"

DataSourceID="BugsDataSource" OnRowUpdated="BugsGridView_RowUpdated">

<Columns>...</Columns>

</asp:GridView>

</ContentTemplate>

</asp:UpdatePanel>

<!--

Done:

The ActivityLabel Label control in the Default.aspx page is encapsulated

inside an UpdatePanel with an ID of ActivityUpdatePanel. The UpdatePanel

does not update when other UpdatePanels on the page generate postbacks.

This UpdatePanel does not contain any other controls.

-->

<!--

Done:

The ActivityUpdatePanel UpdatePanel control in the Default.aspx page

defines a trigger which causes the UpdatePanel to asynchronously refresh

when the Click event of the ClearButton Button is raised.

-->

<asp:UpdatePanel ID="ActivityUpdatePanel" runat="server" UpdateMode="Conditional">

<ContentTemplate>

<asp:Label ID="ActivityLabel" runat="server" />

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTrigger ControlID="ClearButton" EventName="Click" />

</Triggers>

</asp:UpdatePanel>

 

<asp:Button ID="ClearButton" runat="server" Text="Clear"

OnClick="ClearButton_Click" />

 

    protected void BugsGridView_RowUpdated(object sender, GridViewUpdatedEventArgs e)

    {

        if (CheckForChanges(e, "Description", "Status", "AssignedTo"))

        {

            // Done:

            // The BugsGridView_RowUpdated event handler in the _Default partial class

            //  refreshes the ActivityUpdatePanel UpdatePanel if changes have been made

            //  to the BugsGridView GridView control.

 

            ActivityUpdatePanel.Update();

        }

    }

Published Thursday, February 07, 2008 10:53 AM by funky_rus

Comments

# re: AJAX UpdatePanel triggers, Conditional update mode

Monday, February 09, 2009 7:47 AM by 1Madhu

Thanks a lot

# re: AJAX UpdatePanel triggers, Conditional update mode

Wednesday, April 15, 2009 3:07 AM by kapuriya.rakesh

Nice thing

# re: AJAX UpdatePanel triggers, Conditional update mode

Saturday, March 27, 2010 3:37 PM by Upton

Give please. Nothing contributes so much to tranquilizing the mind as a steady purpose - a point on which the soul may fix its intellectual eye. Help me! Looking for sites on: Turbo tax return. I found only this - <a href="turbo-tax.biz/.../">quicken turbo tax</a>. Turbo tax, individuals: eight double-helix 114 on profit website. Turbo tax, the satellite of getting and getting your social chemistry will often store your structure mentor into high baldness. With best wishes :cool:, Upton from Nicaragua.

# re: AJAX UpdatePanel triggers, Conditional update mode

Wednesday, January 05, 2011 11:07 PM by Upton

Give please. Nothing contributes so much to tranquilizing the mind as a steady purpose - a point on which the soul may fix its intellectual eye. Help me! Looking for sites on: Turbo tax return. I found only this - <a href="turbo-tax.biz/.../">quicken  turbo tax</a>. Turbo tax, individuals: eight double-helix 114 on profit website. Turbo tax, the satellite of getting and getting your social chemistry will often store your structure mentor into high baldness. With best wishes :cool:, Upton from Nicaragua.

# re: AJAX UpdatePanel triggers, Conditional update mode

Tuesday, January 18, 2011 5:43 AM by wajeeha

Excellent Article and thanks a lot! I really appreciate

your work and thanks a lot

# re: AJAX UpdatePanel triggers, Conditional update mode

Wednesday, November 30, 2011 10:18 AM by Sheik

Good article for learners. Thanks.

# re: AJAX UpdatePanel triggers, Conditional update mode

Friday, March 22, 2013 6:57 AM by Beeler

My family every time say that I am killing

my time here at net, however I know I am getting familiarity every day by reading such pleasant articles or reviews.

# re: AJAX UpdatePanel triggers, Conditional update mode

Friday, April 05, 2013 7:16 PM by Rhoads

Heya just wanted to give you a brief heads up and let you

know a few of the images aren't loading correctly. I'm not

sure why but I think its a linking issue. I've tried it in two different web browsers and both show the same results.

Leave a Comment

(required) 
(required) 
(optional)
(required)