Control's ID not being rendered

Discussion in 'ASP .Net Building Controls' started by Mike Miller, Jan 7, 2008.

  1. Mike Miller

    Mike Miller Guest

    I have a custom control that is a child control of another custom control.
    If I do not explicitly set the ID, either in the .aspx or in code (if it is
    added dynamically), no ID is rendered in the final markup.

    ASP.net, of course, assigns a default ID - such as ctl001 - when the control
    is created. If you access the ID, ClientID, or UniqueID, you get this value
    back (along with the naming container's ID for the latter two). I would
    expect that the full client ID would then be rendered to the page, regardless
    of whether it was explicitly set.

    However, this is not the case. Name the control explicitly and it's fine.
    Let ASP.Net name it and - not so much. The ID doesn't render. Anyone have
    any ideas on what I might be missing here?

    Thank you.
     
    Mike Miller, Jan 7, 2008
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.