ascx event to parent aspx: howto ?

Discussion in 'ASP .Net Web Controls' started by Support, May 26, 2005.

  1. Support

    Support Guest

    Hello:
    Using vb.net
    I have a web page home.aspx
    that has a placeholder: myplaceholder.
    on Page_load:
    depending a conditions, I either have:
    myplaceholder .Controls.add(MycontrolA)
    or
    myplaceholder .Controls.add(MycontrolB)
    MyControlA contains a submit button
    and
    MyControlB contains a submit button

    I wish to be able to detect in home.aspx
    if either
    MyControlB.Submit was clicked or if MyControlA.Submit was clicked.

    I tried using in MyControlA
    Protected Sub btSubmit_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btSubmit.Click
    RaiseBubbleEvent(Me, e)
    End Sub

    but nothing happens in home.aspx

    Protected Overrides Function OnBubbleEvent(ByVal sender As System.Object,
    ByVal e As System.EventArgs) As Boolean
    Response.Write("<br><br>ParentControl's OnBubbleEvent called.")
    Response.Write("<br>Source of event is: " + sender.ToString())
    End Function

    Help - what am I missing ?

    Thank you!

    T
     
    Support, May 26, 2005
    #1
    1. Advertising

  2. Support

    Guest

    Do you have an addHandler line for myControlA /myControlB?

    On the post-back do you re-create the myControlA / myControlB ?
     
    , May 27, 2005
    #2
    1. Advertising

  3. Support

    Support Guest

    no - I do not recreate myControlA / myControlB because I dont know if it is
    the A or B button that was clicked.
    That is the objective: which submit button in which control was clicked: if
    ButtonA in myControlA then recreate myControlA ...

    Thanks
    <> wrote in message
    news:...
    > Do you have an addHandler line for myControlA /myControlB?
    >
    > On the post-back do you re-create the myControlA / myControlB ?
    >
     
    Support, May 31, 2005
    #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. Quentin
    Replies:
    1
    Views:
    508
    Quentin
    Jul 29, 2003
  2. =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=

    How to rise aspx parent forms event from aspx Child form

    =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=, Oct 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    895
    S. Justin Gengo
    Oct 22, 2005
  3. cindy
    Replies:
    0
    Views:
    428
    cindy
    Sep 9, 2008
  4. Replies:
    1
    Views:
    1,748
    Evan Freeman
    Sep 12, 2008
  5. Joe
    Replies:
    1
    Views:
    396
    Jeffrey Tan[MSFT]
    Feb 16, 2004
Loading...

Share This Page