Id in asp controls not unique

G

Guest

Hello.
Sorry for my english.
I've a little/big problem.
I've a image asp control (with Id="Foto") in a master page. When I run it
the source code of web page (from browser!!) have a different Id from "Foto"
and it is "ctl00_ContentPlaceHolder1_Foto".
Please help me!!
How could I to hold my Id "Foto".

Bye
Cris
 
S

Steve C. Orr [MVP, MCSD]

ASP.NET automatically renames the controls to avoid naming collisions.
Instead of trying to override this useful functionality I suggest you try to
work with it.
You can get the client side ID that ASP.NET is using for the control with
this syntax:
MyControl.ClientID
 

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

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top