如何在网址中使用引导按钮.使用ASP.NET MVC5进行操作 [英] how to use bootstrap button in Url. Action with asp.net mvc5

查看:60
本文介绍了如何在网址中使用引导按钮.使用ASP.NET MVC5进行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是在Url中使用引导按钮的正确方法.行动.

what is the correct way to use bootstrap button with thw Url. Action.

 @Url.Action("Delete", "Delete", null, new { id = item.Id }),new { @class = "btn btn-success btn-xs" })

谢谢

推荐答案

实际上,我认为您使用了错误的帮助程序.您可能想要的是 ActionLink

Actually I think you're using the wrong helper. What you want probably is ActionLink

@Html.ActionLink("Delete", "your action", "your controller", new { id = item.Id },new { @class = "btn btn-success btn-xs" })

如果您仍然想使用Url.Action,就这样使用

if you still want to use Url.Action, just use like this

<a href="@Url.Action("your action", "your controller", new { id = item.Id }" class="btn btn-success btn-xs">Delete</a>

这篇关于如何在网址中使用引导按钮.使用ASP.NET MVC5进行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆