从按钮调用Html.ActionLink?
发布时间:2020-12-14 18:45:03 所属栏目:资源 来源:网络整理
导读:如何调用“注册”ActionLink(在标准MVC5上生成的那个) 从引导按钮使用VS2013的项目? 这是原始代码: @Html.ActionLink("Register","Register","Account",routeValues: null,htmlAttributes: new { id = "registerLink" }) 我试过这个,但显然它不起作用: bu
如何调用“注册”ActionLink(在标准MVC5上生成的那个)
从引导按钮使用VS2013的项目? 这是原始代码: @Html.ActionLink("Register","Register","Account",routeValues: null,htmlAttributes: new { id = "registerLink" }) 我试过这个,但显然它不起作用: <button type="button" class="btn btn-info" onclick="window.location.href('@Url.Action("Register","Account")')">Add New User</button> 解决方法<input type="button" class="btn btn-info" value="Let's Go!" onclick="location.href='@Url.Action("Action","Controller")'" /> 这应该工作正常…… (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |