开发者

Is there a better way to implement forms than using RenderAction?

开发者 https://www.devze.com 2023-02-17 08:15 出处:网络
I am working on a .Net MVC2 project where I am trying to modularize functionality as much as possible. One aspect of this would be to place a form in a partial views which is then called using RenderA

I am working on a .Net MVC2 project where I am trying to modularize functionality as much as possible. One aspect of this would be to place a form in a partial views which is then called using RenderAction. This is so that the form's GET, POST, validation and redirection can be handled independently of the parent view.

I have read blogs and forums etc that suggest that this is not ideal behaviour for MVC, however I cannot think of a way round it. The main issue I am having is redirecting from the rendered action and I understand why I cannot do this.

What I need 开发者_如何转开发to know is this: if I can't and shouldn't code my modules in this way, how should I code them so they are independent of the parent view?

0

精彩评论

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

关注公众号