我有一个母版页,上面有一个更新面板。我正在处理的应用程序的其中一个页面有一个自定义控件,上面有一些 asp:textboxes。该控件也有一个gridview。
当单击一行的 asp:linkbutton 时,OnRowCommand 事件会触发并正确执行其魔法,其中一部分是设置 asp:textbox 的“Text”属性。这行得通。
我的问题是更新没有反映在 UI 中。
更新面板:
<asp:ScriptManager ID="scriptManager" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="updPanel" runat="server">
<ContentTemplate>
[...more code...]
链接按钮:
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" CommandArgument='<%# Eval("ID")%>' CommandName="EDIT" runat="server">Edit</asp:LinkButton>
</ItemTemplate>
事件处理程序:
protected void RowCommand(object sender, GridViewCommandEventArgs e)
{
switch (e.CommandName)
{
case "EDIT":
//stuff happens here
[ASP:Textbox].Text = [Result of stuff that happened];
^this is what isn't reflected on the page
break;
我知道我在页面生命周期中遗漏了一些东西,但我正在画一个空白。