Assigned ID gets changed! (FindControl not working)

  • Thread starter Ivan Demkovitch
  • Start date
I

Ivan Demkovitch

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!
 
I

Ivan Demkovitch

SOLVED

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

Changing Page.FindControl to this.FindControl cured problem.
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top