Aligning Issue with web form

Matrim
Matrim used Ask the Experts™
on
This may be blatantly simple but how do you right align the text in a text box on a web form.

Cheers Joss
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi Matrim.

You have to apply the appropriate stly flags and to do this you have to flip the page into HTML view and then add the following style to your textbox

style="text-align:right"

eg

<asp:TextBox id=TextBox1 runat="server" style="text-align:right">hello</asp:TextBox>

however if you're using Visual Studio it has an annoying habit of editing your code for you and so that setting gets lost (arrgghhh) so the next trick is to add it via code

eg

TextBox1.Style["text-align"]="right";

hope this helps

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial