Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

How to add CssClass to SharePoint:TextField dynamically through coding

$
0
0

Hello,

I have a SharePoint:TextField control placed on custom application page and have defined two css classes declaratively with CssClass property of the control.

I want to add one more class programatically when validation fails on server side.

I tried setting CssClass+=" thirdclass". But when I deploy and when check with F12 developer tool, this third class does not get added. It only shows those two classes defined declaratively. I also tried specifying simply CssClass=" firstclass secondclass thirdclass" (without +=) but still it shows only two classes which is defined decalrarively.

When I debug the code, I can see that third class is added but when we see in the browser developer tool. It is not added. When we add that class manually by using developer tool options in browser, it gets added properly with effect. So the problem is how to add classes programmatically to SharePoint:TextField?

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>