Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have an ajax control toolkit modal popup within my update panel and it is firing when the button has been clicked. also it fires server side method if the user clicks on the button which exists within the modal popup.

But my problem is the modal popup will not be fired once the server method called(means once the page has been posted back). if user clicks on the button which triggers the modal popup nothing happens.(but refreshing the page and clicking on the button will open modal popup)

Any idea on this?




I have solved this problem by adding

<asp:PostBackTrigger ControlID="Btn_Submit" />

just inside the update panel trigger :-)


Share this answer
[no name] 24-Jun-11 5:29am    
Edited for Code Block.

I have a sample code here. See if it could help.

in my client code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MemberHistory.aspx.cs"
    Inherits="xp.Client.MemberHistory" Theme="SkinFile" Culture="auto" meta:resourcekey="PageResource1"
    UICulture="auto" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UsersControl/MemberDetails.ascx" TagName="MemberDetails" TagPrefix="uc3" %>
<html xmlns="">

 <body class="bg">
 <form id="form1" runat="server">
       <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
       <asp:UpdatePanel ID="upGridClaims" runat="server" UpdateMode="Conditional">
              <asp:TemplateField HeaderText="Corp Code" SortExpression="CorpCode" Visible="false">
                  <asp:LinkButton ID="glbCorpCode" runat="server" Text='<%# Eval("CorpCode")%>' Width="100%"
                     OnClick="glbCorpCode_Click" ToolTip="Click to view Corporate Benefit List"></asp:LinkButton>
                  <ItemStyle HorizontalAlign="Center" />
          <cc1:ModalPopupExtender runat="server" ID="mpeDetails" TargetControlID="btnDetails"
              PopupControlID="pnlDetails" BackgroundCssClass="modalBackground" BehaviorID="mpeBehavior3"
              PopupDragHandleControlID="pnlDetails" DropShadow="false">
          <asp:Button runat="server" ID="btnDetails" Style="display: none" />
          <asp:Panel runat="server" ID="pnlDetails" Style="display: none;" Width="70%" BackColor="White">
              <uc3:MemberDetails runat="server" ID="ucMemberDetails" />


Then in my code behind:

protected void glbCorpCode_Click(object sender, EventArgs e)
   LinkButton glbCorpCode = sender as LinkButton;
   GridViewRow row = (GridViewRow)glbCorpCode.NamingContainer;
   string corpCode = ((LinkButton)row.FindControl("glbCorpCode")).Text.Trim();
   ucMemberBenefits.DisplayInfo(corpCode); // This is my popup user control I pass value of corpCode
   mpeBenefits.Show();   //Display popup
   upGridClaims.Update();   // Update changes made in popup into Gridview if ever...

This code plays important: <asp:updatepanel id="upGridClaims" runat="server" updatemode="Conditional"> in client code. and the: upGridClaims.Update(); in the code behind

Hope it could help...


Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900