关于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";
}
<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";
}
...全文
相关推荐
如何在UpdatePanel中调用JS客户端脚本
本文将介绍如何在UpdatePanel中调用JS客户端脚本,需要了解的朋友可以参考下
UpdatePanel和jQuery不兼容 局部刷新jquery失效
在做项目中发现,在使用了UpdatePanel的地方,局部刷新后,jquery失效了,后来经过搜索找到不错的解决方法,在此与大家分享下,有类似问题的朋友可以参考下
ScriptManager和UpdatePanel控件实现页面异步局部更新效果
ScriptManager和UpdatePanel控件实现页面异步局部更新效果,VS2008项目文件夹,内附详细的文档说明,文档说明包括空间属性和用法介绍及代码说明。个人实验。
vs.net控件updatePanel实现无刷新的方法
页面部分 代码如下:<asp ID=”ScriptManager1″ runat=”server”> </asp> <h2> 使用VS控件updatePanel实现无刷新 </h2> <p> <asp ID=”UpdatePanel1″ RenderMode=”Block” UpdateMode=”Conditional” runat=”server”> <ContentTemplate> 点击按钮从服务器获取当前时间<as
使用updatepanel局部刷新实现注册时对用户名的检测示例
主要介绍了使用updatepanel局部刷新实现注册时对用户名的检测示例,需要的朋友可以参考下


