Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
How to Apply Style Preset in Codebehind?
posted

This isn't a question specifically related to the "Commands and Editors" forum, but since that is the type of control I'm actually doing this with, I figured I would start there...

I'm building a webcontrol that contains a WebMaskEdit control.  I'd like to apply my companies pre-defined style preset, but am unsure if that is even possible at runtime from vb / codebehind.  I did a couple searches on these forums, but couldn't find any clues.  Can someone help me out?

Thanks,

John

Parents
No Data
Reply
  • 28464
    posted

    Hello John,

    You can try programmatically setting the StyleName and StylePath properties very early in the lifecycle of the control, say PreInit or Init, and see if this has any effect. You need to also make sure that the files for the custom style are available in the site where the custom web control is used.

Children
No Data