Change border properties of ASCX from code-behind?
-
Hi I am building a library of asp.net user controls which I am deriving from a custom UserControlBase class which further derives from actual UserControl class. Hierarchy looks like this : ASCX -> UserControlBase : UserControl I have this requirement to put a border around all the ASCX's. So, I thought if I can modify UserControlBase it will apply to all ASCXs. I tried following code in Page_Load of UserCOntrolBase but its not working
this.Attributes.Add("style", "border-color:#FFFF66;border-width:4px;border-style:Dashed;");
What should I do to make it work? Please advise. Thanks AJ
Follow your goals, Means will follow you ---Gandhi---
-
Hi I am building a library of asp.net user controls which I am deriving from a custom UserControlBase class which further derives from actual UserControl class. Hierarchy looks like this : ASCX -> UserControlBase : UserControl I have this requirement to put a border around all the ASCX's. So, I thought if I can modify UserControlBase it will apply to all ASCXs. I tried following code in Page_Load of UserCOntrolBase but its not working
this.Attributes.Add("style", "border-color:#FFFF66;border-width:4px;border-style:Dashed;");
What should I do to make it work? Please advise. Thanks AJ
Follow your goals, Means will follow you ---Gandhi---
You should use CSS classes rather than hard code these values. When users ask to change it, and they will, it will be much easier. Create a div in the control to act as the border and set its properties not the control itself.
I know the language. I've read a book. - _Madmatt
-
You should use CSS classes rather than hard code these values. When users ask to change it, and they will, it will be much easier. Create a div in the control to act as the border and set its properties not the control itself.
I know the language. I've read a book. - _Madmatt
-
Hi I am building a library of asp.net user controls which I am deriving from a custom UserControlBase class which further derives from actual UserControl class. Hierarchy looks like this : ASCX -> UserControlBase : UserControl I have this requirement to put a border around all the ASCX's. So, I thought if I can modify UserControlBase it will apply to all ASCXs. I tried following code in Page_Load of UserCOntrolBase but its not working
this.Attributes.Add("style", "border-color:#FFFF66;border-width:4px;border-style:Dashed;");
What should I do to make it work? Please advise. Thanks AJ
Follow your goals, Means will follow you ---Gandhi---