redirect-after-post

How do I use the “Post/Redirect/Get” a.k.a. “Redirect after Post” with asp.net

寵の児 提交于 2020-01-10 15:44:26
问题 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 回答1: 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

How do I use the “Post/Redirect/Get” a.k.a. “Redirect after Post” with asp.net

醉酒当歌 提交于 2019-11-30 10:13:36
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); Use Server.Transfer method. The Server.Transfer method has a second

Post-Redirect-Get with ASP.NET

余生颓废 提交于 2019-11-26 12:59:28
How can i implement the Post-Redirect-Get pattern with ASP.NET? A button click performs some processing: <asp:Button id="bbLaunch" OnCommand="bbLaunch_Click" /> User clicks the button, the spacecraft is launched, the web-page redisplays. If the user presses F5, they get the warning: The solution to the problem is the Post-Redirect-Get pattern. What is the method by which PRG can be implemented in ASP.NET? The question centers around the problems of: how can the <asp:Button> perform a POST to a place that isn't its original form? what becomes of the ViewState when you post to a form that doesn

Post-Redirect-Get with ASP.NET

ぃ、小莉子 提交于 2019-11-26 03:10:07
问题 How can i implement the Post-Redirect-Get pattern with ASP.NET? A button click performs some processing: <asp:Button id=\"bbLaunch\" OnCommand=\"bbLaunch_Click\" /> User clicks the button, the spacecraft is launched, the web-page redisplays. If the user presses F5, they get the warning: The solution to the problem is the Post-Redirect-Get pattern. What is the method by which PRG can be implemented in ASP.NET? The question centers around the problems of: how can the <asp:Button> perform a POST