Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Partial Postback reseting dynamically loaded user control

Posted on 2014-04-01
1
Medium Priority
?
686 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 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

927 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