ASP.NET Simple HTML Control Question

Discussion in 'OT Technology' started by doggfather, Jun 28, 2006.

  1. doggfather

    doggfather New Member

    Joined:
    Aug 6, 2005
    Messages:
    224
    Likes Received:
    0
    <script runat="server" language="VB">
    Sub Page_Load()
    subtitle.Style(
    "font-weight") = "bold"
    End Sub
    </
    script>

    <div id="subtitle" runat="server">Subtitle 1</div>
    <div id="subtitle" runat="server">Subtitle 2</div>

    It won't let me have 2 DIVs with the same ID, how can I work around this?
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    why do you want them to have the same id anyways? :confused:

    EDIT: I see what you are trying to do now. Look into CSS.
     
  3. doggfather

    doggfather New Member

    Joined:
    Aug 6, 2005
    Messages:
    224
    Likes Received:
    0
    I know CSS, i dont wnat to use traditional CSS

    This is vERY simplified, but what I'm doing is more complex but this is a very similar suitation, dummed down so it is easily understood

    How can I work around this using ASP.NET?
     
  4. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    you cannot. Form elements, when run at the server, need to have unique id's. You can give the controls different Id's and then enumerate all of the html controls on the page, looking for the div elemens that begin with "xyz" or something like that.
     

Share This Page