Bootstrap 标志符号未显示在窗体中

9lowa7mx  于 2023-02-14  发布在  Bootstrap
关注(0)|答案(1)|浏览(129)

我正在尝试不同的方法来做一个确认表单。我有以下表单以及只是一个超链接。下面的超链接显示的glphicon正确,但表单内的提交按钮只是显示为“提交”在一个灰色的按钮。CSS需要在提交按钮与超链接不同吗?

<div class="text-center">
    @using (Html.BeginForm("Delete", "Patrol", new { id = item.MemberId }))
    {
        @Html.AntiForgeryToken()
        <input type="submit" class="glyphicon glyphicon-trash" onclick="return confirm('Are you sure you want to remove this record?')" />
    }

    <a href="@Url.Action("Delete", new {id = item.MemberId})" onclick="return confirm('Are you sure you want to remove this record?')"><span class="glyphicon glyphicon-trash"></span></a>
</div>
kgqe7b3p

kgqe7b3p1#

使用Firebug或其他调试器,找到定义了glyphiconcss文件。在此css文件中,检查@font-face部分中的src位置。您可能需要进行一些更改(例如,根据glyphicons在项目中的位置添加或删除src部分中的"../"),如下所示:

src: url('../fonts/glyphicons-halflings-regular.eot');
  • 或 *
src: url('../../fonts/glyphicons-halflings-regular.eot');

另一方面,如果某些应用程序文件在发布到服务器后未显示,则可能需要对文件路径应用以下更改:

  • 来自 *
~/../../Content/images/img.png
  • 至 *
./../../Content/images/img.png

并在相关文件的Properties窗口下,检查是否为它们设置了如下属性:
构建操作:* 内容 *
复制到输出目录:* 请勿复制 *

相关问题