开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜