我有一个 jQuery 对话框,打开后立即关闭。它设置为位于 GridView 的模板字段中的按钮。
我的 JavaScript:
<script type="text/javascript">
$(document).ready(function() {
$("#txtBeginDate").datepicker();
$("#txtEndDate").datepicker();
$("#response").dialog({
autoOpen: false,
modal: true,
title: "Equifax Response"
});
$("[id*=lnkEquifaxResponse]").live("click", function EquifaxResopnse() {
$("#response").dialog("open");
});
});
</script>
我的相关 GridView 标记:
<div id="Gridview">
<asp:GridView ID="grClientTransactions" runat="server" AllowPaging="True"
PageSize="25" AutoGenerateColumns="False" DataKeyNames="ResponseXML"
EmptyDataText="Record not found." EmptyDataRowStyle-BackColor="#CCCCCC"
EmptyDataRowStyle-Font-Bold="true" CssClass="mGrid"
PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"
OnPageIndexChanging="grClientTransactions_PageIndexChanging"
onrowcommand="grClientTransactions_RowCommand">
<Columns>
<asp:TemplateField ShowHeader="false">
<ItemTemplate>
<asp:LinkButton ID="lnkEquifaxResponse" runat="server"
CausesValidation="False"
CommandName="EquifaxResponse"
Text="View"
CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" HeaderText="Equifax Response">
<ItemTemplate>
<asp:Label ID="lblEquifaxResponse" runat="server"
Text='<%# Bind("ResponseXML")%>' >
</asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
我的 div 显示带有来自 CodeBehind 的分配字符串的标签:
<div id="response">
<asp:Label ID="lblDialog" runat="server" ></asp:Label>
</div>