Redirecting from cshtml page

前端 未结 4 994
执念已碎
执念已碎 2020-12-18 18:12

I want to redirect to a different view depending on the result of a dataset, but I keep getting returned to the page I am currently on, and can\'t work out why. I drop into

4条回答
  •  离开以前
    2020-12-18 19:07

    You can go to method of same controller..using this line , and if you want to pass some parameters to that action it can be done by writing inside ( new { } ).. Note:- you can add as many parameter as required.

    @Html.ActionLink("MethodName", new { parameter = Model.parameter })

提交回复
热议问题