Solved

Partial Postback reseting dynamically loaded user control

Posted on 2014-04-01
1
655 Views
Last Modified: 2014-04-07
Hi all,

I have a page which has an update panel. Inside the update panel I have a signup process which is split down a number of user controls and loaded using AJAX.

Now I my code follows the tutorial found here;

http://geekswithblogs.net/rashid/archive/2007/08/11/Loading-UserControl-Dynamically-in-UpdatePanel.aspx

Now, in one of the usercontrols I have its own ajax call which loads some HTML and adds to a div on the usercontrol as a kind of popup.

When the user clicks the link inside the usercontrol (which is inside the update panel). the ajax fires, fires the webmethod, returns the html, adds the html to the div, and completes.

at this point the Page_Load in the parent ASPX is firing which then 'reloads' the current usercontrol.

Does anyone have any ideas on how I can supress this reload?
0
Comment
Question by:flynny
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 39968951
You could try wrapping the code in your Page_Load with the following, so it only executes on a full postback:
if (Page.IsPostBack)
{
    if (!ScriptManager.GetCurrent(this.Page).IsInAsyncPostBack)
    {
         ...
    }
}

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question