call aspx function/sub/property from ascx event

Discussion in 'ASP .Net' started by comp, Nov 25, 2004.

  1. comp

    comp Guest

    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".
     
    comp, Nov 25, 2004
    #1
    1. Advertising

  2. comp

    comp Guest

    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".
    >
    >
    >.
    >
     
    comp, Nov 25, 2004
    #2
    1. Advertising

  3. comp

    Karl Seguin Guest

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

    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" <> wrote in message
    news:95ee01c4d348$81edfc20$...
    > 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".
    > >
    > >
    > >.
    > >
     
    Karl Seguin, Nov 26, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Shohet
    Replies:
    1
    Views:
    485
    Kevin Spencer
    Nov 10, 2003
  2. bienwell
    Replies:
    10
    Views:
    945
    bienwell
    Aug 19, 2005
  3. Mr Not So Know It All
    Replies:
    5
    Views:
    1,324
    Mr Not So Know It All
    Dec 28, 2006
  4. Ben
    Replies:
    2
    Views:
    898
  5. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    2,043
    Lawrence D'Oliveiro
    May 20, 2011
Loading...

Share This Page