Exec function from user control..

Discussion in 'ASP .Net' started by Matthew Wells, Feb 7, 2008.

  1. Hello,

    I'm using ASP.net 2.0 with C#. I have a user control with 4 buttons on
    it. I want to execute a function on the main form's code behind page from
    the click event of the user control button. How do I do that?

    Thanks.

    Matthew Wells
     
    Matthew Wells, Feb 7, 2008
    #1
    1. Advertisements

  2. Matthew Wells

    bruce barker Guest

    the user control could expose an event, or expose the button as a property to
    the main form

    -- bruce (sqlwork.com)


    "Matthew Wells" wrote:

    > Hello,
    >
    > I'm using ASP.net 2.0 with C#. I have a user control with 4 buttons on
    > it. I want to execute a function on the main form's code behind page from
    > the click event of the user control button. How do I do that?
    >
    > Thanks.
    >
    > Matthew Wells
    >
    >
    >
    >
     
    bruce barker, Feb 7, 2008
    #2
    1. Advertisements

  3. Matthew Wells

    Manish Guest

    Hi Mathews,

    you can use delegate to raise event of the child control in the Main page.
    Please refer to the link below to do this.

    http://chiragrdarji.blogspot.com/2007/08/raise-event-from-user-control-to-main.html

    Regards,
    Manish
    www.ComponentOne.com


    "bruce barker" wrote:

    > the user control could expose an event, or expose the button as a property to
    > the main form
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Matthew Wells" wrote:
    >
    > > Hello,
    > >
    > > I'm using ASP.net 2.0 with C#. I have a user control with 4 buttons on
    > > it. I want to execute a function on the main form's code behind page from
    > > the click event of the user control button. How do I do that?
    > >
    > > Thanks.
    > >
    > > Matthew Wells
    > >
    > >
    > >
    > >
     
    Manish, Feb 7, 2008
    #3
  4. Thanks. It looks complicated, but I'll give it a try.

    "Manish" <> wrote in message
    news:...
    > Hi Mathews,
    >
    > you can use delegate to raise event of the child control in the Main page.
    > Please refer to the link below to do this.
    >
    > http://chiragrdarji.blogspot.com/2007/08/raise-event-from-user-control-to-main.html
    >
    > Regards,
    > Manish
    > www.ComponentOne.com
    >
    >
    > "bruce barker" wrote:
    >
    >> the user control could expose an event, or expose the button as a
    >> property to
    >> the main form
    >>
    >> -- bruce (sqlwork.com)
    >>
    >>
    >> "Matthew Wells" wrote:
    >>
    >> > Hello,
    >> >
    >> > I'm using ASP.net 2.0 with C#. I have a user control with 4
    >> > buttons on
    >> > it. I want to execute a function on the main form's code behind page
    >> > from
    >> > the click event of the user control button. How do I do that?
    >> >
    >> > Thanks.
    >> >
    >> > Matthew Wells
    >> >
    >> >
    >> >
    >> >
     
    Matthew Wells, Feb 8, 2008
    #4
    1. Advertisements

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. Tom Rowton
    Replies:
    2
    Views:
    923
    Tom Rowton
    Aug 1, 2003
  2. Mad Scientist Jr
    Replies:
    0
    Views:
    892
    Mad Scientist Jr
    Mar 22, 2006
  3. Hal Vaughan
    Replies:
    11
    Views:
    1,516
    Gordon Beaton
    May 22, 2006
  4. tedsuzman
    Replies:
    2
    Views:
    7,566
    Michel Claveau, résurectionné d'outre-bombe inform
    Jul 21, 2004
  5. Ted
    Replies:
    1
    Views:
    671
    Duncan Booth
    Jul 22, 2004
  6. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    806
    Jonathan Wood
    Feb 2, 2010
  7. Guillermo Riojas
    Replies:
    0
    Views:
    326
    Guillermo Riojas
    Nov 26, 2010
  8. Random Task
    Replies:
    12
    Views:
    1,150
    Joe Smith
    Dec 4, 2005
Loading...