want_to_be_calm
want_to_be_calm

Reputation: 1627

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 .

Upvotes: 1

Views: 67

Answers (1)

Mark Cilia Vincenti
Mark Cilia Vincenti

Reputation: 1614

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.

Upvotes: 1

Related Questions