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

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?

Thanks,

Vasanth
Posted

Hi,

I have solved this problem by adding

<triggers>
<asp:PostBackTrigger ControlID="Btn_Submit" />
</triggers>

just inside the update panel trigger :-)

Thanks,

Vasanth
   
v2
Comments
[no name] 24-Jun-11 5:29am
   
Edited for Code Block.
Hi,

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

in my client code:

XML
<%@ 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="http://www.w3.org/1999/xhtml">
   ...
   ...

 <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:GridView>
              <asp:TemplateField HeaderText="Corp Code" SortExpression="CorpCode" Visible="false">
                  <ItemTemplate>
                  <asp:LinkButton ID="glbCorpCode" runat="server" Text='<%# Eval("CorpCode")%>' Width="100%"
                     OnClick="glbCorpCode_Click" ToolTip="Click to view Corporate Benefit List"></asp:LinkButton>
                  </ItemTemplate>
                  <ItemStyle HorizontalAlign="Center" />
              </asp:TemplateField>
          </asp:GridView>
       </asp:UpdatePanel>
       ...
       <div>
          <cc1:ModalPopupExtender runat="server" ID="mpeDetails" TargetControlID="btnDetails"
              PopupControlID="pnlDetails" BackgroundCssClass="modalBackground" BehaviorID="mpeBehavior3"
              PopupDragHandleControlID="pnlDetails" DropShadow="false">
          </cc1:ModalPopupExtender>
          <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" />
          </asp:Panel>

       </div>
    </form>
 </body>
</html>



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...

Regards,

Algem
   
v5

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