I am creating 2 web server controls for our project using telerik asp.net ajax controls. Controls are derived from ISkinnableControl interface.
I have created skin by modifying exisiting skin file css classes to build our skin. I want to use custom prefixes for css (i,e myCalendar). Reason is that same telerik control is used in both user controls.If I use telerik style class prefixes there could be clash in style.
//code to set css to control (inside userconctrol.cs)
On Aspx page I have RadSkinManager to apply skin to control instances.
To Apply skin, Currently I have 2 options. I have to do it for each control instance.
1. Set it in markup at design time
2. Set it via page_preinit event.
How can I achieve following
Use custom preffixes in css stylesheets. When RadSkinManager skin changes, it should automatically apply it to control instances. I don't want user to register control instances in radSkinmanager targetControls collection / assign skin it to indivisual control instances.
Note: I am storing css files in library assembly and using stylesheetmanager to load them in application.
My problem is similar to
http://www.telerik.com/community/forums/aspnet-ajax/skin-manager/generic-code-to-apply-skin-to-all-user-controls-on-page.aspx
Thanks & Regards
Parag
I have created skin by modifying exisiting skin file css classes to build our skin. I want to use custom prefixes for css (i,e myCalendar). Reason is that same telerik control is used in both user controls.If I use telerik style class prefixes there could be clash in style.
.myCalendar_<skinname> .rcTitlebar table
{
table-layout
:
auto
;
width
:
100%
;
border-collapse
:
separate
;
border
:
0
;
border-style
:
none
;
}
//code to set css to control (inside userconctrol.cs)
protected
override
void
CreateChildControls()
{
base
.CreateChildControls();
_calendar =
new
RadCalendar();
_calendar.EnableEmbeddedSkins =
false
;
_calendar.EnableEmbeddedBaseStylesheet =
false
;
_calendar.CssClass =
"myCalendar myCalendar_"
+ Skin;
_calendar.Skin = Skin;
...
}
On Aspx page I have RadSkinManager to apply skin to control instances.
To Apply skin, Currently I have 2 options. I have to do it for each control instance.
1. Set it in markup at design time
2. Set it via page_preinit event.
How can I achieve following
Use custom preffixes in css stylesheets. When RadSkinManager skin changes, it should automatically apply it to control instances. I don't want user to register control instances in radSkinmanager targetControls collection / assign skin it to indivisual control instances.
Note: I am storing css files in library assembly and using stylesheetmanager to load them in application.
My problem is similar to
http://www.telerik.com/community/forums/aspnet-ajax/skin-manager/generic-code-to-apply-skin-to-all-user-controls-on-page.aspx
Thanks & Regards
Parag