希望在asp.net中停止页面刷新 [英] hOW to stop page refreshing in asp.net
问题描述
要停止在asp.net中刷新页面
hOW to stop page refreshing in asp.net
推荐答案
通常在asp.net中,当您单击按钮或将整个页面张贴在页面上时服务器并返回到客户端浏览器.
为避免这种情况,您可以使用 AJAX
将按钮或控件放在 UPDATEPANEL 内,以进行页面发布.
并将页面的一部分放入 UPDATEPANEL 中,该部分将被更改.
通过使用它而不是整个页面"帖子,仅页面的所需部分将被更改.3
例如..
normally in asp.net when you clicks on a button or post the page entire page get posted on the server and return back to the client browser.
To avoid this you can use AJAX
put the button or control inside the UPDATEPANEL Which make page post.
and put the part of the page in UPDATEPANEL which will get changed.
By Using this instead of Entire Page post only required part of the page will get changed.3
eg..
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
< asp:updatepanel id ="UpdatePanel1" runat ="server" xmlns:asp =#unknown">
< contenttemplate>
< asp:label id ="Label1" runat =服务器" text ="Label">
< asp:button id ="Button1" runat ="server" text ="Upload" onclick ="btnUpload_Click"/>
Button1_click()
{
Label1.Text = DateTime.Now.ToString();
}
<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
<asp:label id="Label1" runat="server" text="Label">
<asp:button id="Button1" runat="server" text="Upload" onclick="btnUpload_Click" />
Button1_click()
{
Label1.Text = DateTime.Now.ToString();
}
当您想停止页面刷新时,您能解释一下吗?
when u want to stop page refreshing ,could u explain ?
这篇关于希望在asp.net中停止页面刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!