is there any way to change skinId in codeBehind?
I tried it during setting other property, but it’s not working. The skin is not applied.
public GlobalImageButtonType Skin {
get { return _skin; }
set
{
_skin = value;
this.SkinID = _skin.ToString();
this.CommandName = _skin.ToString();
LoadDefaultValues();
}
}
I also tried loop throught page.contols, but in page_onpreinit event is controls collection empty.
Is it possible to change the SkinId elsewhere than in aspx page?
Thanks
SkinID can only be changed programmatically on or before OnPreInit – your only option to initiate this for a control is in the Page’s OnPreInit.
Under normal circumstances, .Controls should be available at that stage.
In some cases, you need the following work-around for .master pages:
You can now have controls that need skinning implement some interface (IRuntimeSkinableControl) that allows them to assign their own skins:
The control would apply it like so: