473,395 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Centering on a Label Web Control in ASP.NET

I am adding a Label control to a page that I am going to be dynamically
setting the text during runtime and I want to center the control. I can't
figure out how to center it. Does anyone know?

Thanks in advance,
Jul 21 '05 #1
4 1828
Add TEXT-ALIGN to the style

<asp:Label id="Label1" style="TEXT-ALIGN: center"
runat="server">Label</asp:Label>
--
Xavier Pacheco
Xapware Technologies Inc

manage your projects: www.xapware.com/ActiveFocus.htm
the blog: www.xavierpacheco.com/xlog
the book: http://www.amazon.com/exec/obidos/AS...vierpacheco-20
Jul 21 '05 #2
That works great. Thanks!!! Do you know if it is possible to do this from
the IDE or does it have to be done at runtime?

"Todd" wrote:
I am adding a Label control to a page that I am going to be dynamically
setting the text during runtime and I want to center the control. I can't
figure out how to center it. Does anyone know?

Thanks in advance,

Jul 21 '05 #3
Todd,

Please do not open new threads, although my answer is there.

Cor
Jul 21 '05 #4
Todd,

Please do not open new threads, although my answer is there.

Cor
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Todd | last post by:
I am adding a Label server control to an ASPX page using the .NET IDE. I can't figure out how to center it automatically. I know you can do it by editing the html and making it: <asp:Label...
1
by: Brian Conway | last post by:
Is there a way to center text inside a label in a webform?
2
by: anonymous | last post by:
I have created a DataGrid control with checkboxes, TextBoxes, ComboBoxes, and NumericUpDowns. Since I used the DataGridBoolColumn, the checkbox is displayed in the center of the cell, horizontally...
16
by: tshad | last post by:
I am trying to center a button in a datagrid column in asp.net and it doesn't seem to work. I have the following: <asp:TemplateColumn ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">...
2
by: Todd | last post by:
I am adding a Label control to a page that I am going to be dynamically setting the text during runtime and I want to center the control. I can't figure out how to center it. Does anyone know? ...
2
by: Joe Delphi | last post by:
Hi, I want to position label text so that it always appears centered when the user re-sizes the browser window. I tried adding the HTML property text-align="CENTER" to the code, but ASP.NET...
1
by: K Viltersten | last post by:
I'm playing around with the XAML-builder in VS2k8 and it seems that <Label Height="28" Margin="0,10,0,0" Name="label1" VerticalAlignment="Top" TextBlock.TextAlignment="Center"></Label> ...
4
by: SAL | last post by:
Hello, is there a way to menu control dynamically center itself horizontally on a page? I have placed a menu control in a panel control (no ajax) and would like it to center itself. Depending on...
1
by: dazzler | last post by:
Maybe the topic should be how to put background colors to sizers, but anyway... could anyone please help me, I need to have "background color for buttons", like in example blue & red, and then using...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.