Hi,
I want to change css style from the same Css file during runtime. I am doing this as follows…
aObjLnkBtn.CssClass.Remove(0, aObjLnkBtn.CssClass.Count());
aObjLnkBtn.CssClass = "selected";
But, it is not been applied. How can I achieve this.
Thanks
Sreenath
Amit ChoudharyPosted Apr 13, 2011, 9:12 AM
you don't have to write this code:
aObjLnkBtn.CssClass.Remove(0, aObjLnkBtn.CssClass.Count());
Just
aObjLnkBtn.CssClass = "selected";
is enough. You should look at the html generated after your action of change css. i'm sure it'll be set to 'selected'.
You have to change the style for link button in "selected" and have to introduce the a:hover, a:active: and a tag to the CSS to have your style on linkbutton.
reason: since link button becomes anchor tag after rendering to html and it only takes the css with a:hove, a:active etc.
Hope this helps you.
Thanks.