View Single Post
Old May 22nd, 2005, 05:54 PM
andyj00 andyj00 is offline
Authorized User
Join Date: May 2005
Location: , , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for the reply Peter. This is what I was trying to do......
There is a button on the user control and when the user clicks it, and its event fires, then (amongst other things) retrieve a value from the parent web form page and fire off a stored procedure. I know this "ties" this user control to only work in this web form only - I understand that. I wouldnt normally do this sort of thing with a user control. The reason I am doing this is that I want the flexibility of loading another user control in the original ones place, that is a slight variation of the first user control.
Anyway I have found out how to reference the parent's public property with the code as follows:

Int32 _totalRecords = ((aqreview.MPRSearch.MPRList)this.Parent.Page).Tot alRecords;

where aqreview.MPRSearch.MPRList is the reference to the parent web form and TotalRecords is the public property on that web form.

Thanks for your help.