Assigned ID gets changed! (FindControl not working)

Discussion in 'ASP .Net Web Controls' started by Ivan Demkovitch, Oct 7, 2003.

  1. Hi!

    I have following problem:

    When I create control dynamically and assign ID to it it get's changed if
    you look at output HTML.

    Because I add this control inside ascx it is prefixed with something like
    "ctl0_". Therefore FindControl is not working...

    How to deal with this?

    Thanks!
     
    Ivan Demkovitch, Oct 7, 2003
    #1
    1. Advertising

  2. SOLVED

    Since I had code in ASCX ID was prepended with additional ID for ASCX
    itself.

    Changing Page.FindControl to this.FindControl cured problem.


    "Ivan Demkovitch" <> wrote in message
    news:...
    > Hi!
    >
    > I have following problem:
    >
    > When I create control dynamically and assign ID to it it get's changed if
    > you look at output HTML.
    >
    > Because I add this control inside ascx it is prefixed with something like
    > "ctl0_". Therefore FindControl is not working...
    >
    > How to deal with this?
    >
    > Thanks!
    >
    >
    >
     
    Ivan Demkovitch, Oct 7, 2003
    #2
    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. Ivan Demkovitch
    Replies:
    1
    Views:
    824
    Ivan Demkovitch
    Oct 7, 2003
  2. Stefan Mueller
    Replies:
    5
    Views:
    526
    Steven Saunderson
    Jul 10, 2006
  3. Robert Oschler
    Replies:
    0
    Views:
    111
    Robert Oschler
    Jul 10, 2003
  4. libsfan01
    Replies:
    5
    Views:
    245
    Jeff North
    Dec 20, 2006
  5. pbd22
    Replies:
    9
    Views:
    144
    Gregor Kofler
    Oct 14, 2009
Loading...

Share This Page