开发者

Redirecting from a view to the controller

开发者 https://www.devze.com 2023-03-24 14:30 出处:网络
Can someone help me into this? I am still new to MVC, now I\'ve a controller named \'A\' and called its view.

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

精彩评论

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