use*_*430 1 asp.net-mvc razor asp.net-mvc-3
所以在我的个人资料控制器页面 我在create方法中有一个方法调用create
if (Convert.ToInt32(calBMI) >= 25)
{
return View("Index", Survey);
}
Run Code Online (Sandbox Code Playgroud)
我想将页面呈现为调查索引(调查是另一个控制器照顾调查),我如何做到让它工作,谢谢!
return View("~/Views/Survey/Index.cshtml", objSurvey);
Run Code Online (Sandbox Code Playgroud)
假设objSurvey
您的模型/ ViewModel对象和Survey/index
视图是强类型的objSurvey
Model/ViewModel 类型
编辑:根据评论,如果您的视图没有强类型,您可以忽略第二个参数
public ActionResult GetSomeThing()
{
return View("~/Views/Survey/Index.cshtml");
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1561 次 |
最近记录: |