![](/img/trans.png)
[英]ASP.NET Server is showing different result that in my developer machine?
[英]asp.net css is different in my local machine and remote machine
我的本地計算機上有一個網頁,其標題如下:
<%@ 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中是否有代碼段
<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>
但是,它似乎不適用於遠程頁面按鈕。 可能的原因是什么?如何解決? 我從本地開發環境發布。
嘗試的事情:
1)在每個頁面上按Ctrl + F5,以確保刷新瀏覽器可能緩存的CSS。
2)在瀏覽器中打開開發人員工具,以了解將哪些樣式應用於元素,並且沒有任何JS錯誤或404錯誤丟失。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.