【问题标题】:How to use Font Awesome with Submit Type on the logout button如何在注销按钮上使用带有提交类型的 Font Awesome
【发布时间】:2018-11-28 19:34:56
【问题描述】:

我需要发帖注销,所以我需要一个“输入类型”。

如何更改此输入以便我可以使用 FontAwasone 类

我已经尝试使用按钮标签,但它在“a”标签内不起作用。

           <div class="sidebar-footer">             

           <a href="#">
                <i class="fa fa-envelope"></i>
                <span class="badge badge-pill badge-success notification">7</span>
            </a>

                <a>
                    @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { role = "form" }))
                    {
                         @Html.AntiForgeryToken()
                        <input type="submit" value="Logout" class="btn btn-primary" />
                    }    
                </a>
                //Need to use that Awesome  Class                   
                <a href="#">
                    <i class="fa fa-power-off"></i>
                </a>
        </div>

【问题讨论】:

    标签: c# asp.net-mvc visual-studio font-awesome


    【解决方案1】:

    在这种情况下使用按钮元素应该可以工作,让您可以在其中放入任何您想要的 HTML。

    <button type="submit" class="btn btn-primary">
      <i class="fa fa-power-off"></i>
    </button>
    

    【讨论】:

    • 感谢您的帮助!
    猜你喜欢
    • 2017-07-29
    • 1970-01-01
    • 1970-01-01
    • 2016-07-25
    • 2013-11-26
    • 2019-06-06
    • 2013-03-06
    • 2015-09-02
    • 2015-05-03
    相关资源
    最近更新 更多