我如何使用"邮政/重定向/获取"又称"邮政和QUOT后重定向;用asp.net [英] How do I use the "Post/Redirect/Get" a.k.a. "Redirect after Post" with asp.net

查看:154
本文介绍了我如何使用"邮政/重定向/获取"又称"邮政和QUOT后重定向;用asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

做一个刷新后在asp.net中的某些行动似乎让即使该操作没有意义(想想双删除)再次发生。该网站的方式来处理这种情况是一个后后重定向到得到一个干净的版本的页面,可以刷新不重新发布到Web服务器的作用。我如何与ASP.NET做到这一点。

Doing a refresh after certain action in asp.net seems to make them happen again even when that action doesn't make sense (think double delete). The web way to deal with this situation is to redirect after a post to get a clean version of the page that can be refreshed without reposting an action to the webserver. How can I do this with ASP.NET

推荐答案

我有一种感觉,还有一个更深层次的问题,我没有得到但在这里不用。在你回发事件:

I have a feeling there is a deeper problem I'm not getting but here goes. In your postback event:

// the post handling logic, e.g. the click event code
Response.Redirect(Request.RawUrl);

这篇关于我如何使用"邮政/重定向/获取"又称"邮政和QUOT后重定向;用asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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