For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET Webcontrols > May 2005 > ascx event to parent aspx: howto ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ascx event to parent aspx: howto ?
Support

2005-05-26, 9:01 pm

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




jeff.przylucki@gmail.com

2005-05-27, 8:58 pm

Do you have an addHandler line for myControlA /myControlB?

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

Support

2005-05-31, 9:11 am

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
<jeff.przylucki@gmail.com> wrote in message
news:1117223902.212257.227220@g47g2000cwa.googlegroups.com...
> Do you have an addHandler line for myControlA /myControlB?
>
> On the post-back do you re-create the myControlA / myControlB ?
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com