Solved

Partial Postback reseting dynamically loaded user control

Posted on 2014-04-01
1
667 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 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