views:

143

answers:

3

oPanel = CType(Master.FindControl("panelSearch"), Panel)

This code resides on my masterpage's back-end (theMaster.master.vb), but I get a "Cannot refer to an instance member from within a shared class or shared member initializer without an explicit instance of the class"

the function it resides in IS shared, I just can't remember for the life of me what I need to do to make this work.

thanks!

+1  A: 

You can't access the Master property of the page from a shared function. You must make the function an instance function (remove the Shared keyword) before you can use the Master property.

bdukes
+2  A: 

Remove the Shared modifier on your method that this code is written in.

Mehrdad Afshari
A: 

like I said, im stupid right now. thanks guys

Anders