在我的表單中我有一個標籤和按鈕控件。 默認情況下,標籤是可見的。當用戶點擊按鈕時,我已將標籤設置爲可見。 對於簡單的按鈕它正在工作,但是當我添加一個updatePanel到按鈕時,事件被激發,但標籤沒有變爲可見的假。試試這個,請任何人都可以告訴我爲什麼會發生這種情況以及解決方案。關於更新面板的困惑
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:fileupload ID="Fileupload1" runat="server"></asp:fileupload>
<asp:Label ID="Label1" runat="server" Text="Label" ></asp:Label>
<asp:UpdatePanel ID="up" runat ="server" >
<ContentTemplate >
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("hello");
Label1.Visible = false;
}