Why did the name of a control changed?

F

Fabian

Hi,

I work with MasterPages in ASP.NET 2.0.
In codebehind I create a dynamic control and with name "CatId". But after
the creation the name is changed to "ctl00$Main$CatId".
Therefore I can´t serach by the name of the control, but I need this.
What I must do, that this not take place?

Fabian
 
K

Karl

This is no different than in ASP.Net 1.0, the UniqueId or ClientId of a
control is based on the hierarchy the control is placed in.

Your control, CatId is added to a contentplaceholder which is part of a
master page.

Your masterpage is ctl00
your contentplaceholder is Main
and your control is CatId

However, I agree with you that CatId should be accessible from the Page as
simply "CatId" which it doesn't appear to be.
Have you looked through the feedback site for any similiar reports?

Karl
 
F

Fabian

Thanks for Answer,

in the same page I can access the control. But I want to access the value in
the next page with this method: PreviousPage.FindControl ("CatId")

What can I do?
Or is there an other way to transfer the object?
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top