user controls - access variable of master from usercontrol -


i have masterpage variable. know how use variable on childpage mastertype. search how variable inside usercontrol (the control on childpage)?

maybe childpage need pass "pointer" of masterpage usercontrol?

i try use mastertype on usercontrol but

'master' not member of 'system.web.ui.usercontrol  on designer.vb     public shadows readonly property master() mastertypename                                     return ctype(mybase.master, mastertypename)                 end     end property 

is there way mastertype know usercontrol?

instead of trying figure out how value master page control, why not use control intended? controls meant able independent of pages (and master pages) reside on. instead, create publicly accessible property in user control can set child page. example, if had in user control:

''' <summary> '''some summary show in properties window ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <description("your description here")> public property somevalue string = "something" 

you can access property in either in client code of resides or in code behind. example:

 <cc3:mycontrol id='mycontrol1' runat="server" someproperty="helloworld"/> 

or in codebehind:

mycontrol1.someproperty ="helloworld" 

you can expose events in similar manner.

let me know if helps or if there reason not work you.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -