Hello,
I have a custom style sheet, which I use successfully with various controls. I have an issue with a RadButton which I am trying to use as an image button. I find that on initial entry the RadButton styles are not taking effect. On postback the styles DO take effect. Other styles from the same stylesheet DO take effect immediately on initial entry against other controls defined in the same user control.
Some specifics: 1) This is a SharePoint web part which defines user controls dynamically. One of these user controls has the RadButton (which has the problem) and also contains other controls (which DO work).
2) I am using a RadAjaxPanel - all User Controls are added to this Panel.
3) The buttons are disabled in the code on initial entry.
4) the gradient styling does not work at all.
Here is an extract from the styles.css:
.classImage
{
background
:
url
(images/previousAsset
200
x
23
.png), linear-gradient(to
bottom
,
#f2f2f2
,
#a9a9a9
),
-webkit-gradient(linear,
left
top
,
left
bottom
, from(
#ffffff
), to(
#cbcbcb
)),
-moz-linear-gradient(
top
,
#f2f2f2
,
#a9a9a9
) ;
background-position
:
8px
2px
;
background-repeat
:
no-repeat
;
width
:
250px
;
height
:
23px
;
border
:
solid
;
border-radius:
4px
;
border-width
:
1px
;
border-color
:
black
;
/*padding: 0px 7px 0px 4px ;*/
/* top right bottom left */
padding
:
2px
4px
;
}
.classHoveredImage
{
/*background-position: 0 -10px;*/
}
.classPressedImage
{
/*background-position: 0 -20px;*/
}
Here is an extract of the ascx file:
<
SharePoint:CssLink
ID
=
"cssLink1"
runat
=
"server"
DefaultUrl
=
"XXX.SharePoint.YYY/Styles.css"
/>
<
telerik:RadPanelBar
ID
=
"RadPanelBar1"
runat
=
"server"
ExpandMode
=
"FullExpandedItem"
Width
=
"900px"
Height
=
"116px"
>
<
Items
>
<
telerik:RadPanelItem
Text
=
"Asset Search"
Expanded
=
"true"
>
<
ContentTemplate
>
<
table
style
=
"width:100%; text-align:center"
>
<
tr
>
<
td
>
<
telerik:RadButton
ID
=
"PreviousAssetRadButton"
runat
=
"server"
Width
=
"210px"
Height
=
"23px"
Text
=
"Previous Asset"
ButtonType
=
"StandardButton"
ToolTip
=
"Find the prior asset on the pipeline."
OnClick
=
"PreviousAssetRadButton_Click"
CssClass
=
"classImage"
HoveredCssClass
=
"classHoveredImage"
PressedCssClass
=
"classPressedImage"
Image-IsBackgroundImage
=
"true"
>
<
Image
ImageUrl
=
"/_layouts/15/images/XXX.SharePoint.YYY/previousAsset56X23.png"
EnableImageButton
=
"true"
/>
</
telerik:RadButton
>