Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > ascx event to parent aspx: howto ?

Reply
Thread Tools

ascx event to parent aspx: howto ?

 
 
Support
Guest
Posts: n/a
 
      05-26-2005
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




 
Reply With Quote
 
 
 
 
jeff.przylucki@gmail.com
Guest
Posts: n/a
 
      05-27-2005
Do you have an addHandler line for myControlA /myControlB?

On the post-back do you re-create the myControlA / myControlB ?

 
Reply With Quote
 
 
 
 
Support
Guest
Posts: n/a
 
      05-31-2005
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
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Do you have an addHandler line for myControlA /myControlB?
>
> On the post-back do you re-create the myControlA / myControlB ?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
dynamic loaded ascx delegate event not firing in parent form CMELLO@tams.com ASP .Net Building Controls 1 09-12-2008 06:20 PM
dynamic loaded datalist ascx event delegate not firing in parent f cindy ASP .Net 0 09-09-2008 04:16 PM
datasource of child .ascx not visible to parent .ascx Joe ASP .Net Web Controls 1 02-16-2004 07:27 AM
[ASCX] Add an ascx in a webcontrol... Quentin ASP .Net 1 07-29-2003 07:37 PM



Advertisments