引导glyphicon表格不显示 [英] Bootstrap glyphicon not showing in Form

查看:146
本文介绍了引导glyphicon表格不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试不同的方式做一个形式与确认。我在表格下面以及刚刚超链接。超链接下面是正确显示glyphicon但形式里面的提交按钮只显示在一个灰色的按钮,提交。请问CSS需要在不同的提交按钮VS超链接?

 < D​​IV CLASS =TEXT-中心>
    @using(Html.BeginForm(删除,巡逻,新{ID = item.MemberId}))
    {
        @ Html.AntiForgeryToken()
        <输入类型=提交级=glyphicon glyphicon-垃圾的onclick =返回确认('您确定要删除此记录吗?')/>
    }    < A HREF =@ Url.Action(删除,新{ID = item.MemberId})的onclick =返回确认('您确定要删除此记录吗?')><跨度类=glyphicon glyphicon-垃圾>< / SPAN>< / A>
< / DIV>


解决方案

使用萤火虫或其他调试器,找到 CSS 文件,在其中的 glyphicon 定义。在这种 CSS 文件的 @字体面的src 位置C>部分。您可能需要做出一些改变(例如添加或删除 ../ ')中根据你的的src 部分在您的项目> glyphicons 位置如下图所示:

  SRC:URL('../字体/ glyphicons-半身-regular.eot');

  SRC:URL(../../字体/ glyphicons-半身-regular.eot');


在另一方面,如果某些应用程序文件都没有发布到服务器后显示出来,您可能需要应用到有关文件的路径如下更改:

从的

 〜/../../内容/图片/ img.png

  ./../../内容/图片/ img.png

和下属性相关文件的窗口,检查是否如下图所示为他们设置的属性:

生成操作:内容的结果
复制到输出目录:不要复制

希望这有助于...

I'm trying out different ways to do a form with a confirm. I have the following in form as well as just a hyperlink. The hyperlink below is displaying the glyphicon correctly but the submit button inside the form is just displaying as "submit" in a gray button. Does the CSS need to be different in the submit button vs a hyperlink?

<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>

解决方案

Using Firebug or another debugger, find the css file in which the glyphicon is defined. In this css file check the src location at @font-face section. You might need to make some changes (i.e. adding or removing ' ../ ') in the src section according to your glyphicons location in your project as shown below:

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

or

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


On the other hand, if some of the application files are not displayed after publishing it to the server, you might need to apply the following changes regarding to file path:

from

~/../../Content/images/img.png

to

./../../Content/images/img.png

And under Properties window of the related files, check if the properties set for them as shown below:

Build Action : Content
Copy to Output Directory: Do not copy

Hope this helps...

这篇关于引导glyphicon表格不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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