Aligning asp Listbox (again!)

C

Coleen

Okay I got an answer on this once, and I have been trying it again, but it
doesn't work! I thought it did (it does for textboxes but NOT for Listbxes)
here is the HTML: (the listbox is in an html table...
<tr>
<td colspan="3" align="center">
<asp:ListBox id="lst_exist_fleet" runat="server"
Width="50%"></asp:ListBox></td>
</tr>

Here is the code that I have tried and am trying in VB.net code-behind:

I've tried this both on PreRender and on PageLoad and tried both ways...
lst.Attributes.Add("style", "text-align: center;")
lst..Style.Add("Text-Align", "center")

Neither of these works for a listbox. Please, can anyone help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top