如何停止页面刷新 [英] how to stop the page refresh

查看:77
本文介绍了如何停止页面刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生,

请说明如何停止按钮点击事件的页面刷新,或者下拉列表选择的索引已更改

Dear Sir,
please explain how to stop page refresh on button click event, or dropdownlist selected index changed

推荐答案

两者事件将数据从客户端回发到服务器。这就是页面刷新的原因。
使用 Updatepanel 避免这种情况。

查看以下链接以了解更多信息:

http://msdn.microsoft.com/en-us/library/aa720471%28v=vs.71%29.aspx [<一个href =http://msdn.microsoft.com/en-us/library/aa720471%28v=vs.71%29.aspxtarget =_ blanktitle =New Window> ^ ]

http://msdn.microsoft.com/en-us/library/ms178472 .ASPX [ ^ ]
Both the Events postback the data from client to the server.That's why the page get refreshed.
Use Updatepanel to avoid this.
Check these links to know more about this:
http://msdn.microsoft.com/en-us/library/aa720471%28v=vs.71%29.aspx[^]
http://msdn.microsoft.com/en-us/library/ms178472.ASPX[^]


对于按钮或下拉列表,设置其AutoPostBack属性如果您正在使用客户端事件,则返回false。



如果您正在编写服务器端事件,则可以使用更新面板。
For button or dropdownlist set its AutoPostBack property to false if you are using client side events.

if you are writing server side events then you can use an update panel.


这篇关于如何停止页面刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆