How to get the parent page values from the usercontrol.
I have a usercontrol in a page. On click of the usercontrols button i wanna get some values from the page after executing a method. i need those values in my usercontrol. What is the best way to get the results of the page in the usercontrol.
How to get the parent page values from the usercontrol. I have a usercontrol
Share
Raw way:
First access Page property:
http://msdn.microsoft.com/en-us/library/system.web.ui.control.page.aspx
Next You can cast Page property to Your page type (whatever it is) or You can use Page.FindControl method to find Page values from other controls.
http://msdn.microsoft.com/en-us/library/31hxzsdw.aspx
In nice way, user control should expose event fired when this button has been clicked and page should subscribe to this event and return data to control.
Is this what You are looking for?