Ben*_*ior 12 html asp.net-mvc twitter-bootstrap
如何从引导按钮调用"注册"ActionLink(使用VS2013在标准MVC5项目上生成的那个)?
这是原始代码:
@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
Run Code Online (Sandbox Code Playgroud)
我试过这个,但显然它不起作用:
<button type="button" class="btn btn-info" onclick="window.location.href('@Url.Action("Register", "Account")')">Add New User</button>
Run Code Online (Sandbox Code Playgroud)
Bur*_*urk 23
<input type="button" class="btn btn-info" value="Let's Go!" onclick="location.href='@Url.Action("Action", "Controller")'" />
Run Code Online (Sandbox Code Playgroud)
这应该工作正常......
小智 6
@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { @class = "btn btn-primary", @role="button" })
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
30819 次 |
| 最近记录: |