Automatically generated Inline style in Validation Controls

Last post 07-01-2009 11:05 PM by Allen Chen – MSFT. 3 replies.

Sort Posts:

  • Automatically generated Inline style in Validation Controls

    06-25-2009, 6:27 AM
    • Member
      3 point Member
    • pedlin
    • Member since 11-14-2008, 9:29 AM
    • Posts 6

    I have a problem with my validation controls getting the auto-generated inline style "color" and "visibility", and thereby ignoring my linked in CSS.

    I've read about setting the ForeColor="" and the Display=Dynamic, but my biggest problem is that the controls only get this inline setting in our production environment...not in my local machine.

    Our production system uses IIS 6.0 but my local machine uses IIS 7.0. Could this be the issue? And how do I solve it?


    When I look at the html source code it looks like this:


    Production:

    <span id="ctl00_BodyContentPlaceHolder_PxPaymentControl_rfvEmail" class="errorValidators" style="color:Red;visibility:hidden;">Required</span>


    Local machine:

    <span id="ctl00_BodyContentPlaceHolder_PxPaymentControl_rfvEmail" class="errorValidators">Required</span>



    I have no such thing as the "style=color:Red;visibility:hidden;" in my code. Why does this happen, and why does it not happen on my local machine?


    Please help me, Im stucked.


    Pedlin

  • Re: Automatically generated Inline style in Validation Controls

    06-25-2009, 7:27 AM
    Answer
    • All-Star
      33,976 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,552

    You could override it by using !important in your css such as

    .errorValidators
    {
    
          color: #00ff00 !important;
    
    }


  • Re: Automatically generated Inline style in Validation Controls

    07-01-2009, 4:40 AM
    • Member
      3 point Member
    • pedlin
    • Member since 11-14-2008, 9:29 AM
    • Posts 6

    Thanks for the reply.

    I know about the !important declaration but it doesn’t really answer my question. I'd like to understand why the inline style is generated differently on my local machine? Is it the IIS version? Why does this happen?

    I'd like to avoid using the !important declaration (thinking about browser support etc), and I will not take away the "visibility:hidden" style (I know I can set the display property of the validation control to dynamic). The problem is that I don’t want it to generate the inline style automatically. And I cant figure out why this happens...


    L





  • Re: Automatically generated Inline style in Validation Controls

    07-01-2009, 11:05 PM

     Hi,

    Could you upload a demo project to http://skydrive.live.com/ and post the download link here for me to test?

    Sincerely,
    Allen Chen
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (4 items)