Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • I understand that PRG is a common design pattern for form submission. In Web forms every page is one form, and having multiple forms on the same page can be a pain. So we tend to use Response.Redirect alot which is a http temporary move. Commented May 27, 2018 at 22:35
  • @grim Web forms is trying to simulate building web apps in the same way you'd build a desktop app which relies on event handlers and maintaining client state. If you asp.net server controls what you're seeingis just how it works. You need to remember it predates many current architectures. Of course you don't have to use any server controls but you can't use the builtin event handles. I'm not really sure what your objection is though. There's no rule you can't redirect to the page you're on, and 302 is appropriate. Commented May 28, 2018 at 22:46
  • Thanks, Yeah I guess its just the current framework which forces the use of 302 versus more modern frameworks which you tend to use 302's very less often. 302's are bad for SEO, and they are much slower. Seems like web form applications in general tend to use the PRG pattern alot more. Commented May 29, 2018 at 15:04
  • @Grim I think you're overly worried about 302s; especially after a form post, since search engines don't post to forms anyway, so what happens after a post is irrelevant. I'm not sure what you're comparison for speed is either. Server.Transfer has its own issues/limitations as well. Even if you were doing MVC, best practices would still have you do post/redirect/get. Commented May 29, 2018 at 22:50