Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 29, 2012 11:52 AM by roopeshreddy
Feb 28, 2012 11:00 AM|LINK
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
RequireFieldValidator.CssClass = "myclass";
Feb 28, 2012 11:18 AM|LINK
hi..you can tryu like this...
RequireFieldValidator.CssClass = "";
Feb 28, 2012 12:02 PM|LINK
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...
Feb 28, 2012 01:22 PM|LINK
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.
Please 'Mark as Answer' if this post helps you.
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
Feb 29, 2012 11:52 AM|LINK
Yeah! you can do that!