I have css class and dynamically (using serverside code) applied this css to my control's cssClass property. But i need to remove only font related style elements from the control. Any possibility for this. I tried remove method of css style. but this
is not working
Since your CSS class is in the client side, it applies to your control from the client side. So even though you remove the styles from server side, when it comes back to client side, it takes all the styles from the CSS class. Easiest way is to have another
class without the font related elements and apply it dyncamically.
Thanks friends. Actually i am creating one custom control for validation summary. So when the user set my control's cssClass autoamtically i map this CssClass to all the validationControls also. So that user no need to specify each validation control css
class. But my control's CssClass no used to set color of error message, instead font also can be change and font size also can be changed. This will affect the text of validation control. So that i like to remove font syles only from the css class when applying
to validation controls.
So now i need to give a property color in my control for color and set this for all controls
Regards,
Akhil Raj K R
Please Mark as Answer if it helps u...
akhilrajau
Participant
1744 Points
537 Posts
Remove css element from dyanamically applied cssClass
Feb 28, 2012 11:00 AM|LINK
hi all,
I have css class and dynamically (using serverside code) applied this css to my control's cssClass property. But i need to remove only font related style elements from the control. Any possibility for this. I tried remove method of css style. but this is not working
Eg:
RequireFieldValidator.CssClass = "myclass";
ReuiredFieldValidator.Attributes.CssStyle.Remove("font");
Akhil Raj K R
Please Mark as Answer if it helps u...
vijay_myl
Contributor
5070 Points
1068 Posts
Re: Remove css element from dyanamically applied cssClass
Feb 28, 2012 11:18 AM|LINK
hi..you can tryu like this...
My .NET blog
Submit Article
roopeshreddy
All-Star
20119 Points
3320 Posts
Re: Remove css element from dyanamically applied cssClass
Feb 28, 2012 12:02 PM|LINK
Hi,
You can't do that! You can't remove only particular style!
Instead you can create separate style, which doesn't have font defined and assign it to the RequiredFieldValidator!
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
Ruchira
All-Star
42885 Points
7019 Posts
MVP
Re: Remove css element from dyanamically applied cssClass
Feb 28, 2012 01:22 PM|LINK
Hi,
Since your CSS class is in the client side, it applies to your control from the client side. So even though you remove the styles from server side, when it comes back to client side, it takes all the styles from the CSS class. Easiest way is to have another class without the font related elements and apply it dyncamically.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.akhilrajau
Participant
1744 Points
537 Posts
Re: Remove css element from dyanamically applied cssClass
Feb 29, 2012 12:21 AM|LINK
Thanks friends. Actually i am creating one custom control for validation summary. So when the user set my control's cssClass autoamtically i map this CssClass to all the validationControls also. So that user no need to specify each validation control css class. But my control's CssClass no used to set color of error message, instead font also can be change and font size also can be changed. This will affect the text of validation control. So that i like to remove font syles only from the css class when applying to validation controls.
So now i need to give a property color in my control for color and set this for all controls
Akhil Raj K R
Please Mark as Answer if it helps u...
roopeshreddy
All-Star
20119 Points
3320 Posts
Re: Remove css element from dyanamically applied cssClass
Feb 29, 2012 11:52 AM|LINK
Hi,
Yeah! you can do that!
Hope it helps u...
Roopesh Reddy C
Roopesh's Space