开发者

Redirecting from a view to the controller

Can someone help me into this?

I am still new to MVC, now I've a controller named 'A' and called its view.

What I want to happen is that I want to redirect from A's view to another controller for example controller 'B'.

Is tha开发者_Python百科t possible to happen?

Please help.

Thanks

Jason


You can use the RedirectToAction method

MSDN example

public ActionResult LogOff() {
    FormsAuth.SignOut();
    return RedirectToAction("Index", "Home");
}

First parameter is the Action name and second is the controller name.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜