关于UpdatePanel控件不能实现局部刷新的问题
下面是我做的一个例子,因为要用在毕设里,我先做了个实验,代码如下,但是在按了Button后,发现页面还是全部都刷新了。不知是为什么?
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<asp:Label ID="labN" runat="server" Style="z-index: 100; left: 100px; position: absolute;top: 63px" Text="Label"></asp:Label>
<asp:Button ID="Button1" runat="server" Style="z-index: 102; left: 141px; position: absolute;top: 63px" Text="Button" OnClick="Button1_Click1" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
这是.cs后台文件里Button键的事件。
protected void Button1_Click1(object sender, EventArgs e)
{
labN.Text = "Hello";
}