简体   繁体   English

Response.Redirect.to到同一页面而没有页面刷新

[英]Response.Redirect to same page without Page Refresh

I need to do a response.redirect to the same page. 我需要做一个response.redirect到同一页面。 How can I do this without the page "refreshing" or "flashing"? 没有页面“刷新”或“闪烁”怎么办? I can't use updatepanels because, this is a search website and I want the user to be able to use the browser's back button. 我无法使用updatepanels,因为这是一个搜索网站,并且我希望用户能够使用浏览器的后退按钮。 I have some search filters on the page, and each time a filter is clicked, I do a resposne.redirect (to the same page) with the appropriate query strings. 我在页面上有一些搜索过滤器,每次单击过滤器时,我都会使用适当的查询字符串来执行resposne.redirect(到同一页面)。

Thanks. 谢谢。

The only way you can do this without a "flicker" or "refresh" if you will is to do an AJAX call and update all your necessary fields. 如果不这样做,唯一的方法就是不进行“闪烁”或“刷新”操作就是进行AJAX调用并更新所有必要字段。 Otherwise Response.Redirect() will flicker your page. 否则Response.Redirect()将使您的页面闪烁。

Have a look at the EnableHistory property of the ScriptManager control. 看一下ScriptManager控件的EnableHistory属性。 Introduced in .NET 3.5 SP1, it allows the browser to maintain a history points for partial postbacks. 在.NET 3.5 SP1中引入,它允许浏览器维护部分回发的历史记录点。 This means the user can navigate through these history points through use of the forward/back buttons on their browser. 这意味着用户可以使用浏览器上的前进/后退按钮浏览这些历史点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Webforms response.redirect返回正确的URL并重新加载同一页面 - Webforms response.redirect returns correct URL and reloads same page Response.Redirect() 重定向到子文件夹中的页面 - Response.Redirect() to redirect to a page in a subfolder 在 .net 中不使用 Response.Redirect(url) 发生错误时重定向到自定义页面? - Redirect to custom page in case of error without using Response.Redirect(url) in .net? Response.Redirect在登录页面中不起作用 - Response.Redirect doesn't work in login page 会话变量在response.redirect上清除(“ page.aspx”,false) - Session variables clearing on response.redirect ('page.aspx",false) Response.Redirect从Web解决方案文件夹内的页面重定向? - Response.Redirect from a page inside a folder of web solution? Response.Redirect仅刷新页面,不将用户重定向到新页面 - Response.Redirect only refreshes page, does not redirect user to new page 使用Response.Redirect完成页面重定向后,如何查找上一页? - How to Find previous page after page redirect done using Response.Redirect? Response.Redirect设置为另一个页面,但再次通过当前页面的Page_Load - Response.Redirect is set to another page, but goes through Page_Load on current page again Amazon AWS上托管的ASP.NET WebForms站点中Response.Redirect和Page.ResolveUrl的问题 - Issue with Response.Redirect and Page.ResolveUrl in ASP.NET WebForms site hosted on Amazon AWS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM