Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing variables between pages and user controls

Status
Not open for further replies.

glyn6

Programmer
Nov 2, 2009
561
GB
I've got a master page with a user control in it and a content page.

I do a database call in the page_load of the content page and want to pass one of the resultant values to the user control in the master page.

Is there a way other than setting a session variable to pass the value? Is there a way to make a global variable accessible from every page/control in the project?
Thanks
 

Yes,
You can set a variable as Global in the standard Module which will ba accessible from anywhere in your app, but it is not the best way to deal with it.

If you have both 'pages' open at the same time, why don't you just (in content page):
[tt]
master_page.User_ControlX.Property = Me.SomeValue
[/tt]

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top