1

現在、ItemTemplateに次のGridViewがあります。

<asp:LinkButton ID="lbEdit" runat="server" CommandName="Edit">
    <asp:Label ID="Label6x" runat="server" Text='<%# Bind("progress_full") %>' /></asp:LinkButton>

これは正常に機能し、クリックすると、現在次のものが含まれているEditTemplateが表示されます。

<asp:DropDownList ID="DropDownList3" runat="server" 
    SelectedValue='<%# Bind("progress") %>'>
    <asp:ListItem Value="0">In queue</asp:ListItem>
    <asp:ListItem Value="1">Being worked on</asp:ListItem>
    <asp:ListItem Value="2">Complete</asp:ListItem>
</asp:DropDownList><br />
<asp:LinkButton ID="lbUpdate" runat="server" CommandName="Update" Text="Update" />

ドロップダウンに変更を加えてクリックする代わりに、ドロップダウンを取得して、コマンドが変更されたときにコマンドを自動的に実行しUpdate、すぐにItemTemplateに戻すにはどうすればよいUpdateですか?

4

1 に答える 1

1

AutoPostBack="true"ドロップダウンリストに追加して設定しますOnSelecIndexChanged="DropDownList1_SelectedIndexChanged"

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
   //execute here your update
   ......
}
于 2012-09-04T15:42:48.713 に答える