In an asp.net, how to get a reference of a custom webcontrol from a usercontrol?
-
Hi I have a page which holds a custom webcontrol and a usercontrol. I need to reference of webcontrol in usercontrol class. So, I make the declaration of webcontrol as public in page class. But, when I do “this.Page.”, I don’t see the webcontrol listed in list provided by intellisense. Most probably, I am missing something. In an asp.net page, how to get a reference of a custom webcontrol from a usercontrol? Please advise. Thanks Pankaj
Follow your goals, Means will follow you ---Gandhi---
-
Hi I have a page which holds a custom webcontrol and a usercontrol. I need to reference of webcontrol in usercontrol class. So, I make the declaration of webcontrol as public in page class. But, when I do “this.Page.”, I don’t see the webcontrol listed in list provided by intellisense. Most probably, I am missing something. In an asp.net page, how to get a reference of a custom webcontrol from a usercontrol? Please advise. Thanks Pankaj
Follow your goals, Means will follow you ---Gandhi---
while using that custom control or user control in aspx page, you must have provided the "ID" of the control right? You should get that control just by refering to ID. No need of call "Page.(....)" :) If you are loading dynamically from code behind still you get it directly by "ID" property's value.(of course in that case you need to set the ID property then while dynamically adding that to page control) Let me know whether you get that!!
Thanks, Arindam D Tewary