具有重定向动作方法的Partial View Controller [英] Partial View Controller with redirect action method

查看:78
本文介绍了具有重定向动作方法的Partial View Controller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用局部视图来显示登录表单和注册表单,我在视图页面和控制器中使用@ {Html.RenderAction("Register","Account");}调用控制器,我有一个重定向动作方法将其重定向到首页重定向时,我收到错误消息,因为子操作方法无法执行重定向操作方法".我在哪里做错了?有人可以为此提出任何解决方案吗?

谢谢

解决方案

,您无法重定向以加载部分视图.您可以使用@ html.Render()或@ html.RenderPartial()或至少@ html.Action().
希望这可以帮助您在实现所需功能时变得更加清晰..
htmlpartial-vs-htmlaction-mvc-razor.html

partial-views-with-diefferent-models.html [ ^ ]

Hi,
Im using a partial views to display login form and registration form, Im calling controllers using @{Html.RenderAction("Register", "Account");} in view page and in controller I have a redirect action method which redirects it to home page Im getting error while redirecting as "Child action methods cannot perform redirect action mehods" .Where am I doing wrong? Can any one suggest any solution for this???

Thanks

解决方案

you cannot redirect to load partial views. you can use @html.Render() or @html.RenderPartial() or at least @html.Action().
hope this will help you in getting some clarity in implementing what u want..
htmlpartial-vs-htmlaction-mvc-razor.html
and
partial-views-with-diefferent-models.html[^]


这篇关于具有重定向动作方法的Partial View Controller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆