public string actionA()
{
var resultB = RedirectToRoute(new { controller = "controllerB", action = "Index", userId = user.Id, applicantId = applicant.Id }); //返回string json字符串
var resultC = RedirectToRoute(new { controller = "controllerC", action = "Index", userId = user.Id, applicantId = applicant.Id }); //返回string json字符串
//return resultB和resultC组成一个string返回
}

本文展示了一个使用C#进行控制器间跳转的例子,通过RedirectToRoute方法实现了从ActionA跳转到ControllerB和ControllerC的Index方法,并传递了用户ID和申请人ID作为参数。
1074

被折叠的 条评论
为什么被折叠?



