Monday, March 26, 2012

ok, now it's working. the question is if what i did is correct

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

>--Original Message--
>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".
>
>.
>Check out: http://www.openmymind.net/communication/index.html
it takes about communication between a page and a user control including how
to do it via events.
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"comp" <nice_guy@.inter.net.il> wrote in message
news:95ee01c4d348$81edfc20$a601280a@.phx.gbl...
> 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
>

0 comments:

Post a Comment