how 2 call func on parent page & return value?

J

Jason Shohet

My control needs a value called 'orgID' which the parent page will have.
I want to avoid the parent page setting values in textboxes etc, in the ascx
control since this violates encapsulation principles (right?)
SO...
I want to know if InvokeMember can be used to return a value from the
parent. ie:

Type myParent = this.Page.GetType();
string strOrgid = myParent.InvokeMember("GetOrgID", System.Reflection...
null, this.Page, new object[]{ });

If I make GetOrgID a function on the parent that returns a string, can the
above work?
Or is there a better way for the ascx to request values from its parent.

TY Jason Shohet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top