【问题标题】:asp.net css is different in my local machine and remote machineasp.net css 在我的本地机器和远程机器上是不同的
【发布时间】:2019-06-04 12:33:37
【问题描述】:

我的本​​地机器上有一个网页,其标题如下:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="CommuteEdit.aspx.cs" Inherits="Web.CommuteEdit" %>

在我的本地机器中,按钮行为正常,具有以下属性:

<input class="rbDecorated" type="submit" name="ctl00$ContentPlaceHolder1$uiSave2" id="ctl00_ContentPlaceHolder1_uiSave2_input" value="Save" tabindex="-1" style="color: white !important; background-color: #486190 !important;">

最后有风格。 但是,当我将网站发布到远程机器时,缺少相同按钮的样式

<input class="rbDecorated" type="submit" name="ctl00$ContentPlaceHolder1$uiSave2" id="ctl00_ContentPlaceHolder1_uiSave2_input" value="Save" tabindex="-1">

我发现远程机器的属性中缺少样式部分。

我检查了 MasterPage.Master 中有一个 sn-p 代码

<script type="text/javascript">
        <!--//
        // For applying special style to primary color
        function SetStyleToButton(buttonID) {
            var ctrl = document.getElementById(buttonID + '_input');
            if (ctrl != null) {
                ctrl.setAttribute('style', 'color: white !important; background-color: #486190 !important;');
            }
        }
        //-->
    </script>

但是,它似乎不适用于远程页面按钮。可能的原因是什么,我该如何解决?我从本地开发环境发布。

【问题讨论】:

    标签: c# css asp.net


    【解决方案1】:

    要尝试的事情:

    1) Ctrl+F5 确保您刷新浏览器可能缓存的 CSS。

    2) 在您的浏览器中打开开发人员工具,以了解哪些样式应用于您的元素,以及您没有任何 JS 错误或 404 缺失错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-10
      • 1970-01-01
      • 1970-01-01
      • 2019-08-08
      • 1970-01-01
      • 2016-04-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多