?
Solved

set textbox align center

Posted on 2005-04-23
4
Medium Priority
?
1,807 Views
Last Modified: 2008-03-10
Hi,

How can we set a textbox control to align center? The textbox is inside a table.

also for drop down list box

Thanks.
0
Comment
Question by:EdwardPeter
  • 2
4 Comments
 
LVL 7

Assisted Solution

by:ayha1999
ayha1999 earned 400 total points
ID: 13850824
Hi,

<tr>
<td align="middle"><asp:TextBox id="" ...</asp:TextBox></td>

hope this helps.

ayha
0
 

Author Comment

by:EdwardPeter
ID: 13850850
ayha1999,

My apology, align the text inside the textbox.

Thanks.
0
 
LVL 6

Accepted Solution

by:
sansoftura earned 1600 total points
ID: 13851035
In the textbox add style="text-align: center;"
<asp:TextBox id="TextBox1" style="text-align: center;" runat="server"></asp:TextBox>

If you want you can create a css class and then asign it to the textbox

HTML
====
<asp:TextBox id="TextBox1" CssClass="txtAlign" runat="server"></asp:TextBox>

CSS
===
.txtAlign
{
      text-align: center;
/*
Add other style for the textbox if you want.
*/
}
0
 

Author Comment

by:EdwardPeter
ID: 13854220
sansoftura,

style="text-align: center;"

Sadly doesn't work for drop down list box. is there another way?

Thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question