asp.net - Access data on Page from Web Control -
I have created a web control, and it requires some data from my original page. How can this data reach?
Updates: Thanks for the quick solution, though they do not work for me. Visual Studio does not recognize the name of the page as a page. I take that name where Class defind:
public partial class Apps_Site_Templates_CollegesMain: cUICommonFeatures (cUICommonFeatures system from inherit.Web.UI.Page)
But in control, when I define
protected system Web.UI.Page parentPage; Original page = (Apps_Site_Templates_CollegesMain) page; I get a fault error: The type or namespace name 'Apps_Site_Templates_CollegesMain' could not be found (Are you missing usage instructions or an assembly reference?).
I think that I am missing something really original here, and I will be very embarrassed if I get the answer, but I need help ....
< / Div>
Controls should be written to rely on those pages a. If a piece of data is needed in the control, then it should expose a public property which is the type of data that it requires, this page is wo uld, then set that property to the data that Control is needed. It allows control that is used on any other page, or even makes part of UserControl, and then userControl is used on the original page.
Comments
Post a Comment