Hi, i am having problem with ajax.net updatepanel. I have an aspx page , in which i have an update panel . In the update panel i have place holder and i load a user control dynamically into the placeholder via ajax call. I have a button out side of the update panel some where else in the aspx page , which i use as a trigger to the update panel.Problem is that every things works fine for the first time, but on second click on the button , it posts back instead of using an asynchronous call to server.
Here is my code behind file :
public partial class dlgTesting : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "document.getElementById('"+myDialogue.ClientID+"').style.display='block';");
AsyncPostBackTrigger foo = new AsyncPostBackTrigger();
foo.ControlID = "Button1";
foo.EventName = "Click";
UpdatePanel1.Triggers.Add(foo);
}
protected void Button1_Click(object sender, EventArgs e)
{
plcHdrDlg.Controls.Clear();
Control temp = LoadControl("~/UserControls/dialogues/tempDialogue.ascx");
plcHdrDlg.Controls.Add(temp);
UpdatePanel1.Update();
}
}
I would appreciate if some can help me identify and remove the problem.
Kind Regards,
Ahsan




Bookmarks