开发者

See which view contains the form that posted to a controller action

开发者 https://www.devze.com 2023-02-03 11:40 出处:网络
I have a contoller action that a number of forms will post to, all in different views. 开发者_开发知识库Is there a way, in my controller action, to see which view contained the form that posted to it?

I have a contoller action that a number of forms will post to, all in different views. 开发者_开发知识库Is there a way, in my controller action, to see which view contained the form that posted to it?

I need this to determine to where to redirect the action when the code in the post action is complete. Thank you!


Two options...you can add a field to your form (or query string) that provides the redirect url. Or you can look at the HttpRequest.UrlReferrer field. It will provide you with the full URL which you have to parse to get the original form.

Hope this helps

0

精彩评论

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

关注公众号