Access Parent Page Members From The User Control.
-
Hi, I need to access the members (controls,properties,methods) in the Parent Page from the User Control which is contained in it. For the controls I tried looping through the controls in the Parent Page but I am not able to find the textboxes as they are rendered as a literal control. Also how do I access the properties and methods of the Parent Page from the User Control. Please help me out. Thanks in advance, Aakar.
-
Hi, I need to access the members (controls,properties,methods) in the Parent Page from the User Control which is contained in it. For the controls I tried looping through the controls in the Parent Page but I am not able to find the textboxes as they are rendered as a literal control. Also how do I access the properties and methods of the Parent Page from the User Control. Please help me out. Thanks in advance, Aakar.
This does not seem like a good design for your application. What does this control do and why should it see all page members? Can you just cast the
Page
property of the control to the container page type (if this control is always used in the same page).
Hesham A. Amin My blog
-
Hi, I need to access the members (controls,properties,methods) in the Parent Page from the User Control which is contained in it. For the controls I tried looping through the controls in the Parent Page but I am not able to find the textboxes as they are rendered as a literal control. Also how do I access the properties and methods of the Parent Page from the User Control. Please help me out. Thanks in advance, Aakar.
you can access parent control but this is not proper way instead you can create properties in user control those required
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "