点击按钮后如何避免postpack? [英] How to avoid postpack on button click?

查看:59
本文介绍了点击按钮后如何避免postpack?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大页面。在页面中间我做一些动作,如添加,更新。现在添加或更新使用按钮点击时间记录更新但页面刷新并转到页面顶部如何修复它。



我的尝试:



i have one large page.in middle of the page i do some actions like add ,update .now add or update using button click that time records is updated but the page is refresh and goto top of the page how to fix it.

What I have tried:

OnClientClick="return false;"



但这是块代码隐藏。并且使用了一些方法但不起作用。


But this is block codebehind.and use some methods but not works.

推荐答案

如果您不想让页面在刷新后返回到顶部,请使用注释中的F-ES Sitecore提及设置。
If you do not want to have the page go back to the top after a refresh then use the setting F-ES Sitecore mentions in comments.
MaintainScrollPositionOnPostback





如果您不想要回发,则需要重新编写代码以使用Ajax调用jQuery或类似的东西。



或者,你可以按照Bhola在评论中提到的那样,将你的控件放到UpdatePanel中,这样回发对用户来说就不那么明显了。



If you do not want the postback you need to re-write your code to use Ajax calls using jQuery or something similar.

Or, you can do as Bhola mentions in the comments, put your controls into an UpdatePanel so that the postback is not as noticeable to the user.


这篇关于点击按钮后如何避免postpack?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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