Solved

Partial Postback reseting dynamically loaded user control

Posted on 2014-04-01
1
641 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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Setting location of a form 4 21
Wpf develop 5 29
C# DataGridView_RowsAdded event not firing 1 36
Round up to 100% in .NET 10 39
jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now