1

I'm using a ValidatorCalloutExtender on a RequiredFieldValidator and decided to change the style from the default to a more 'Modern UI'. I found a Wonderful Post Which helped me get all the relevant CSS fields. I proceeded to change the style and was very happy with the result. I tested in IE, Chrome, and FireFox and it worked perfectly. I then Installed on the production server and noticed the CSS is NOT rendered correctly, no matter which browser I use.

http://s14.postimg.org/gn5kjgovl/Rendered_Differently.png Example Image

I have included my CSS below (Just incase I've done something wrong).

/* AjaxControlToolkit Validator */
.validatorCalloutHighlight 
{
 border:solid;
 border-color: #FFCC00;
    /*background-color: lemonchiffon;*/ 
}
.ajax__validatorcallout_popup_table
{
 /*position:absolute;*/
 min-width: 350px;
 min-height: 40px;
 /*padding: 8px;*/
 background: #FFCC00;
 -webkit-border-radius: 0px;
 -moz-border-radius: 0px;
 border-radius: 0px;
 margin-left:250px;
 margin-top:-20px;
 color:black;
}
.ajax__validatorcallout_popup_table:after
{
 content: '';
 position:absolute;
 border-style: solid;
 border-width: 20px 20px 0 0;
 border-color: #FFCC00 transparent transparent transparent;
 display: block;
 width: 0;
 bottom: -20px;
 left: 0px;
}
/* The popup table row */
.ajax__validatorcallout_popup_table_row
{

}
/* The callout cell */
.ajax__validatorcallout_callout_cell
{

}
/* The table in the callout cell */
.ajax__validatorcallout_callout_table
{

}
/* The callout table row */
.ajax__validatorcallout_callout_table_row
{

}
/* The error message cell */
.ajax__validatorcallout_error_message_cell
{

}
/* The warning icon cell */
.validator_callout .ajax__validatorcallout_icon_cell
{
 padding:0px;
}
.validator_callout .ajax__validatorcallout_icon_cell img
{
 /* Remove the 'Warning' icon */
 display: none;
}
/* The close button cell */
.ajax__validatorcallout_close_button_cell
{

}
/* The arrow cell */
.ajax__validatorcallout_arrow_cell
{
 display:none;
}
/* Inner div of a cell. Used in the close button */
.ajax__validatorcallout_innerdiv 
{

}

The ASP code is below

<asp:TextBox ID="txtUsername" runat="server" Width="300px"></asp:TextBox>
                                    <asp:RequiredFieldValidator CssClass="validator_callout" ID="reqvalUsername" runat="server" ControlToValidate="txtUsername" Display="None" ErrorMessage="Enter a new login name" ValidationGroup="Submit">*</asp:RequiredFieldValidator>
                                    <cc1:ValidatorCalloutExtender ID="reqvalUsername_ValidatorCalloutExtender" runat="server" CloseImageUrl="~/Images/Buttons/cancel_Validator.png" HighlightCssClass="validatorCalloutHighlight" TargetControlID="reqvalUsername" PopupPosition="TopRight" WarningIconImageUrl="~/Images/Status/clear.png">
                                    </cc1:ValidatorCalloutExtender>

I even went so far as to alter the web.config with a custom header, which did not resolve my problem. CSS renders differently on web server than on development environment

I would very much like to use the new style and feel that like it is only something small I've overlooked, but I'm out of ideas on how to resolve this. Could anybody please assist with this frustrating problem?

Community
  • 1
  • 1

1 Answers1

1

up the CSS, trying to see if anything I change make any difference, it didn't. Nothing I tried could remove the default LemonChiffon notification... until I found this post hidden away on the interwebz. http://amityug.org/wordpress/ziems/2014/12/19/how-to-re-position-the-asp-net-ajax-validatorcalloutextender/. I don't know who wrote that entry, but I thank you for taking the time to write and post it!

Specifically, the CSS contained to completely override the default css applied to the ValidatorCalloutExtender.

.CustomValidator {position:relative;margin-left:-80px;}    
.CustomValidator div {border:solid 1px Black;background-color:LemonChiffon; position:relative;}    
.CustomValidator td {border:solid 1px Black;background-color:LemonChiffon;}    
.CustomValidator .ajax__validatorcallout_popup_table {display:none;border:none;background-color:transparent;padding:0px;}    
.CustomValidator .ajax__validatorcallout_popup_table_row {vertical-align:top;height:100%;background-color:transparent;padding:0px;}    
.CustomValidator .ajax__validatorcallout_callout_cell {width:20px;height:100%;text-align:right;vertical-align:top;border:none;background-color:transparent;padding:0px;}    
.CustomValidator .ajax__validatorcallout_callout_table {height:100%;border:none;background-color:transparent;padding:0px;}    
.CustomValidator .ajax__validatorcallout_callout_table_row {background-color:transparent;padding:0px;}    
.CustomValidator .ajax__validatorcallout_callout_arrow_cell {padding:8px 0px 0px 0px;text-align:right;vertical-align:top;font-size:1px;border:none;background-color:transparent;}    
.CustomValidator .ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv {font-size:1px;position:relative;left:1px;border-bottom:none;border-right:none;border-left:none;width:15px;background-color:transparent;padding:0px;}    
.CustomValidator .ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv div {height:1px;overflow:hidden;border-top:none;border-bottom:none;border-right:none;padding:0px;margin-left:auto;}    
.CustomValidator .ajax__validatorcallout_error_message_cell {font-family:Verdana;font-size:10px;padding:5px;border-right:none;border-left:none;width:100%;}    
.CustomValidator .ajax__validatorcallout_icon_cell {width:20px;padding:5px;border-right:none;}    
.CustomValidator .ajax__validatorcallout_close_button_cell {vertical-align:top;padding:0px;text-align:right;border-left:none;}    
.CustomValidator .ajax__validatorcallout_close_button_cell .ajax__validatorcallout_innerdiv {border:none;text-align:center;width:10px;padding:2px;cursor:pointer;}    

The final result with my validator style included

/* AjaxControlToolkit Validator */
.validatorCalloutHighlight 
{
    border:solid;
    border-color: #FFCC00;
    /*background-color: lemonchiffon;*/ 
}
.CustomValidator
{
    position: absolute;
    /*margin-left: -80px;*/
    /*left:-200px;*/
}
.CustomValidator div
{
    border: none;
    background-color: #FFCC00;
    position: relative;
    color:black;
}
.CustomValidator td
{
    border: none;
    background-color: #FFCC00;
    color:black;
}
.CustomValidator .ajax__validatorcallout_popup_table
{
    display: none;
    border: none;
    background-color: transparent;
    padding: 0px;
}
.CustomValidator .ajax__validatorcallout_popup_table_row
{
    vertical-align: top;
    height: 100%;
    background-color: transparent;
    padding: 0px;
}

.CustomValidator .ajax__validatorcallout_callout_cell
{
    text-align: right;
    vertical-align: top;
    border: none;
    background-color: transparent;
    padding: 0px;
}

.CustomValidator .ajax__validatorcallout_callout_table
{
    height: 100%;
    border: none;
    background-color: transparent;
    padding: 0px;
}

.CustomValidator .ajax__validatorcallout_callout_table_row
{
    background-color:transparent;
    padding: 0px;
}

.CustomValidator .ajax__validatorcallout_callout_arrow_cell
{
    padding: 8px 0px 0px 0px;
    text-align: right;
    vertical-align: top;
    border: none;
    background-color: transparent;
}

.CustomValidator .ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv
{
    position: relative;
    left: 1px;
    border-bottom: none;
    border-right: none;
    border-left: none;
    width: 15px;
    background-color: transparent;
    padding: 0px;
}

.CustomValidator .ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv div
{
    height: 1px;
    overflow: hidden;
    border-top: none;
    border-bottom: none;
    border-right: none;
    padding: 0px;
    margin-left: auto;
}

.CustomValidator .ajax__validatorcallout_error_message_cell
{
    min-width:200px;
    max-width:275px;
    min-height:40px;
    padding: 10px 5px 10px 20px;
    border-right: none;
    border-left: none;
    width: 100%;
    font-size: medium;
}


.CustomValidator .ajax__validatorcallout_error_message_cell:after
{
    content: '';
    position:absolute;
    border-style: solid;
    border-width: 0px 20px 20px 0px;
    border-color: transparent #FFCC00 transparent transparent;
    display: block;
    width: 0;
    top:0px;
/*  bottom:55px;*/
    left: -5px;
}

.CustomValidator .ajax__validatorcallout_icon_cell
{
    width: 20px;
    padding: 5px;
    border-right: none;
    display:none;
}

.CustomValidator .ajax__validatorcallout_close_button_cell
{
    vertical-align: top;
    padding-top: 7px;
    padding-right:30px;
    text-align: right;
}

.CustomValidator .ajax__validatorcallout_close_button_cell .ajax__validatorcallout_innerdiv
{
    border: none;
    text-align: center;
    width: 10px;
    padding: 2px;
    cursor: pointer;
}