0
次のページ(最新のアップデート)が与えられました。私は、無効なポストバックまたはコールバックの例外がスローされることなく、リピータフッターにbtnSubmitとbtnDeleteためのボタンのonclickイベントを処理するにはどうすればよいasp.netリピーターフッター内のボタンonclickの無効なポストバック
<%@ Page Title="" Language="C#" MasterPageFile="~/master/superuser.master" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="permissions_default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="Server">
<h1>Permissions Management</h1>
<div class="row">
<div class="span9">
<form runat="server">
<fieldset>
<legend>CRM User Permissions</legend>
<asp:Repeater ID="rptUserPermissions" runat="server" OnItemCommand="rptUserPermissions_ItemCommand">
<HeaderTemplate>
<table class="table table-striped autowidth">
<thead>
<tr>
<th>User</th>
<th>Program</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container, "DataItem.user_name") %></td>
<td><%# DataBinder.Eval(Container, "DataItem.program_name") %></td>
<td>
<asp:Button ID="btnDelete" Text="Delete" runat="server" CommandName="cmd_Delete" CommandArgument="<%# DataBinder.Eval(Container, "DataItem.id") %>" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
<tr>
<td>
<asp:DropDownList ID="ddUser" runat="server" />
</td>
<td>
<asp:DropDownList ID="ddProgram" runat="server" />
</td>
<td>
<asp:Button ID="btnSubmit" Text="Add New" runat="server" CommandName="cmd_Submit"/>
</td>
</tr>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</fieldset>
</form>
</div>
<div class="span1"> </div>
<div class="span4"></div>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="Server">
</asp:Content>
?
UPDATE:
Parser Error Message: The server tag is not well formed.
何を?それはアイテム行とは見なされていないのですか? – Nebri
フッターのテンプレートは、あなたが持っているようなボタンになると思います。 (申し訳ありませんが、私はその部分を逃しました)。ここに、それが働いているように見える答えがあります。 http://stackoverflow.com/questions/6897141/handling-control-events-from-repeater-footer –
私はあなたの答えの記事とリンクした他のstackoverflow質問から答えを試してみました。どちらもまだ私の最後に無効なポストバックの例外を投げている。質問を最新のコードスニペットで更新します。 – Nebri