call aspx function/sub/property from ascx event

C

comp

I have a user control inside an aspx page. I was able to
create a Public property inside the ascx file and call it
from the aspx but whatever I do, I can't find the way to
cause an event from inside the ascx file to call any
function/sub/property etc. The error I'm getting
is "Reference to a non-shared member required an object
reference".
 
C

comp

I added to the ascx file the following line:
Protected WithEvents cls1 As cls1
where cls1 is the class name of the aspx page and in the
ascx Page_Init i wrote:
cls1 = MyBase.Page

It works fine but - is it the correct way?

Thanks
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top