开发者

How do I dynamically change Form Post URL?

开发者 https://www.devze.com 2023-01-13 09:33 出处:网络
I want to make the results of an ASP.NET form POST \"bookmarkable\", and I\'m thinking of using query parameters to accomplish this.

I want to make the results of an ASP.NET form POST "bookmarkable", and I'm thinking of using query parameters to accomplish this.

The idea is that a user will visit http://domath.com and they will type in a math problem, and view the results. The query and results are visible at http://domath.com?ProblemID={some guid here}

The only part I don't really know is how do I change the target of the form URL since I'm using a POST instead of a GET..

Here are t开发者_Go百科he options I came up with, and I'm not sure what is practical

  • Submit form as usual, server redirects to a URL with the new parameters attached

  • Use a webservice or callback to get new URL. Javascript then updates form target


The first option is the easiest and most common. It follows the Post/Redirect/Get model, which avoids double form submission in addition to letting you bookmark the resulting page.

0

精彩评论

暂无评论...
验证码 换一张
取 消