English 中文(简体)
采用“性别行动”并重新采取“次级控制”行动
原标题:Using RenderAction() and posting back to sub-controller action

我的父母认为,也使次控制人的行动使用<条码>。 实例是一页,有Login部分观点(投入:用户名、密码、记忆和行动:login)。

Execution process

  1. GET for Home/Index - also displays my login control that has its login pointing to sub controller User/Login
  2. User enters credentials and clicks login
  3. POST for User/Login - checks credentials and returns ???

Problem

How do I return back to parent view from my sub controller action User/Login?
My sub controller s partial view can be rendered any page, so I can t just easily return result of parent controller action like:

return new HomeController().Index();

因此,我应如何处理我的副控制者的行动及其部分观点?

EDIT

我可以把母体路线的更多数据带回我的子控制器行动,但我还在我的子控制器行动中收集数据。 举例来说,我必须表明,某人具有强硬性。 后方将失去这些东西......

最佳回答

不是把履行记录的工作排到User/Login,而是用回路,因此,你最终会带上User/Login?returnUrl=/Home/Index(url encoding可能改变这个轨道)。

如果返回的Url被安排在询问中,要求User/Login的行动就应当只是把直接行动退回到返回的Url。

如果情况不明确,则请询问

问题回答

暂无回答




相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签