Aligning asp Listbox (again!)

Discussion in 'ASP .Net Web Controls' started by Coleen, Apr 5, 2006.

  1. Coleen

    Coleen Guest

    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?
    Coleen, Apr 5, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Prince
    Replies:
    2
    Views:
    3,303
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  2. amit
    Replies:
    0
    Views:
    366
  3. che
    Replies:
    2
    Views:
    469
  4. abcd

    Importing again and again

    abcd, Jun 8, 2006, in forum: Python
    Replies:
    9
    Views:
    312
    Maric Michaud
    Jun 9, 2006
  5. Jeff
    Replies:
    1
    Views:
    280
    Alexey Smirnov
    May 17, 2007
Loading...

Share This Page