mRbLACK Posted February 20, 2004 Posted February 20, 2004 OK this is such a small thing why is it so hard!! an ASp:label control how can i center align the text from the .vb code... if you do it on the control itself its easy.. <asP:label style='text-align:center;' blablabla /> sorted its works fine but as soon as i try do it from code it doesnt work? does any one know how to do this? have tried alot of ways... lblError.Style("text-align") = "center" lblError.Style("textalign") = "center" lblError.Style("align") = "center" once again...HEEELP!! :D Quote
bungpeng Posted February 20, 2004 Posted February 20, 2004 What about "myControl.Attributes.Add"? Quote
mRbLACK Posted February 20, 2004 Author Posted February 20, 2004 nope doesnt work, im not sure if maybe asp tags have different attribute names or something? its very odd because it works if you dont dont do it programatically? Quote
kahlua001 Posted February 20, 2004 Posted February 20, 2004 THis is html, when an label is being aligned, its being aligned relative to what?, its parent <p>? if that is the case, then you need to put the align in the <p> or <td> Quote
*Experts* Bucky Posted February 20, 2004 *Experts* Posted February 20, 2004 Have you tried using Attributes.Add in this manner? lblError.Attributes.Add("style", "text-align:center;") Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
MorningZ Posted February 20, 2004 Posted February 20, 2004 Labels evaluate to a <span> tag, which is just a container around the "text" inside, so there is no alignment use a server-side div tag instead... Quote If you make it idiot proof, they'll build a better idiot :-)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.