DetailsViewの上にボタンがあります。クリックすると、「メモの挿入」ダイアログ(iframe内の別のページ)がポップアップ表示されます。このダイアログボックスはJqueryを使用しています。ダイアログポップアップのこの挿入ページにrecordIDを渡す方法がわかりませんでした。
Jqueryコード:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.ui/1.8.6/jquery-ui.min.js"></script>
<link type="text/css" rel="Stylesheet" href="http://ajax.microsoft.com/ajax/jquery.ui/1.8.6/themes/smoothness/jquery-ui.css">
<script type="text/javascript">
$(document).ready(function () {
$('#AddNewProposal').live('click', function (e) {
e.preventDefault();
var page = $(this).attr("href")
//var page = "ProposalCreateNew.aspx"
var pagetitle = $(this).attr("title")
alert(page);
var $dialog = $('<div></div>')
.html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%" frameBorder="0" align="middle"> ></iframe>')
.dialog({
autoOpen: false,
modal: true,
height: 650,
width: 900,
title: pagetitle
});
$dialog.dialog('open');
});
});
</script>
これを試しましたが、「サーバータグに<%...%>を含めることはできません」というエラーが表示されます。
<table width="80%" align="center" >
<tr>
<td width="20%"></td>
<td width="80%" class="PageTitle"></td>
<td width="20%">
<asp:Button runat="server" CommandName="AddNewProposal" ID="AddNewProposal" Text="Create New" href="ProposalCreateNote.aspx" title="Create Note" class="button3"/>
</td>
</tr>
</table
--- Below is my DetailsView which has a label to display the ProposalID, so I want to grab this ID and pass it to the dialog box (URL + ID) when I click the AddNewProposal button.
<asp:TemplateField HeaderText="ProposedID" SortExpression="Name" >
<ItemTemplate >
<asp:Label ID="ProposalID" runat="Server"
style="text-align:left;" Text='<%# Eval("ProposedID")%>' />
</ItemTemplate>
</asp:TemplateField>
助けてください。前もって感謝します。