How to get the control id present in one control page in another control page

Posted by Mahe under ASP.NET on 7/11/2012 | Points: 10 | Views : 1206 | Status : [Member] | Replies : 3
Hi All,

How to get the control id present in one control page in another control page

Regards,
Mahe




Responses

Posted by: Premalatha on: 7/11/2012 [Member] Starter | Points: 25

Up
0
Down
because I have user controls in different contentplaceholders I must first find targeted placeholder (where the user control reside) and then I can search for user control inside it:

protected void Dodaj_Feed_Panel_Click(object sender, EventArgs e)
{
ContentPlaceHolder MySecondContent = (ContentPlaceHolder)this.Parent.Parent.FindControl("MyTestContent2");

UserControl UC_text = (UserControl)MySecondContent.FindControl("text1");
UC_text.Visible = true;
}
http://msdn.microsoft.com/en-us/library/486wc64h.aspx

Premalatha
Software Engineer

Mahe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhiram on: 7/11/2012 [Member] Starter | Points: 25

Up
0
Down
Go thru this link...It has the exact solution to your problem...

http://www.intstrings.com/ramivemula/asp-net/jumpstart-5-access-properties-of-a-usercontrol-from-other-usercontrol-in-asp-net-page/


Thanks
Shanti

Mahe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhiram on: 7/11/2012 [Member] Starter | Points: 25

Up
0
Down
Go thru this link...It has the exact solution to your problem...

http://www.intstrings.com/ramivemula/asp-net/jumpstart-5-access-properties-of-a-usercontrol-from-other-usercontrol-in-asp-net-page/


Thanks
Shanti

Mahe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response