I understand that we can set the various style attributes from code behind using :
divControl.Style("height") = "200px"
But how to set it's class instead of declaring each of the styles from code?
C#
divControl.Attributes["class"] = "myClass";
VB
divControl.Attributes("class") = "myClass"
You'll need to have a rule like this one on your css file
.myClass
{
height:200px;
/*...more styles*/
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With