Solved

Partial Postback reseting dynamically loaded user control

Posted on 2014-04-01
1
663 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL and CLR parameter strings 9 63
Convert VB web project to C# 3 66
Read top line from CSV file 14 58
Secure registration PHP 7 40
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article discusses how to implement server side field validation and display customized error messages to the client.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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