開くとすぐに閉じる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>
CodeBehind から割り当てられた文字列を含むラベルを表示する私の div:
<div id="response">
<asp:Label ID="lblDialog" runat="server" ></asp:Label>
</div>