ajax工具包扩展程序模态弹出窗口 [英] ajax toolkit extender modal popup
问题描述
我的更新面板中有一个ajax控件工具箱模式弹出窗口,单击按钮后即会触发.如果用户单击模式弹出窗口中存在的按钮,也会触发服务器端方法.
但是我的问题是,一旦调用服务器方法(即一旦页面发回),就不会触发模式弹出窗口.如果用户单击触发模式弹出窗口的按钮,则不会发生任何事情.(但刷新页面并单击按钮将打开模式弹出窗口)
有什么想法吗?
谢谢,
Vasanth
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
推荐答案
我已经通过添加
解决了此问题
Hi,
I have solved this problem by adding
<triggers>
<asp:PostBackTrigger ControlID="Btn_Submit" />
</triggers>
就在更新面板触发器内:-)
谢谢,
Vasanth
just inside the update panel trigger :-)
Thanks,
Vasanth
我这里有一个示例代码.看看是否有帮助.
在我的客户代码中:
Hi,
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="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...
}
这段代码很重要:< asp:updatepanel id ="upGridClaims" runat ="server" updatemode ="Conditional"> 在客户端代码中.以及 upGridClaims.Update(); 中的代码
希望对您有帮助...
问候,
代数
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
这篇关于ajax工具包扩展程序模态弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!