简体   繁体   中英

asp.net css is different in my local machine and remote machine

I have a web page in my local machine which have heading in follows:

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

In my local machinen, the button behaves normally which has the following attributes:

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

which have style at the end. However, when I publish the website to remote machine, the style for same button is missing

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

I found the style part is missing in remote machine's attributes.

I checked there is a snippet code in 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>

However, it seems it is not applied to remote page button. What is the possible reason and how can I fix it? I publish from my local dev environment .

Things to try:

1) Ctrl+F5 each page to ensure you refresh the CSS that might be cached by your browser.

2) Open up developer tools in your browser in order to find out which styles are being applied to your elements, and that you don't have any JS errors or 404 missing errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM