I wanted to know if there is a way to access to asp objects in the code behind, but without using the object in itself ?
Let say i have an asp Page in which i have this tag :
<asp:TextBox ID="test" runat="server"></asp:TextBox>
In my code behind i can access to this object using : this.test. But i would like to access it in an other way. Something like :
this.Objects["test"]
Because I’m parsing an xml document in which i have all my asp objects, and then i want to do some processing on it (set Visible to true … )
Do you have any idea ?
Thanks
Found the answer. I’m using SharePoint, so i have to set the context. I can’t do
this.FindControls
so i Added :
Control context = this.Page.Master.FindControl("PlaceHolderMain");
And i use :
context.FindControl();
You could use: