|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to capture click event in aspx from placeholder ->controlof User Controls". However, it did not help me solve the following problem: I need to populate a place holder with one a several controls which contain a submit button. When the parent aspx page loads, I need to load a particular server control into the placeholder. Then I wish to capture, bubble up, the controls submit event to the parent.aspx. Using the If IsPostBack Then Response.Write(Page.Request.Form.GetValues("__EVENTTARGET")(0)) End If displays nothing, I guess meening that parent postback event was not trigered by the submit in the control. The control contains... Public Event MySubmit(ByVal sender As Object, ByVal e As System.EventArgs) Protected Sub btSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btSubmit.Click RaiseEvent MySubmit(sender, Nothing) End Sub Question: How can I, in the parent aspx page tell that btSubmit in control A was clicked, or control B, etc.... Thanks Terry -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-web-controls/200505/1 To know the control the triggered the event you might pass a string instead
of the eventArg, e.g. Public Event MySubmit(ByVal sender As Object, ByVal str As String) I am not sure why you cannot capture the event in the parent form. This simple demo http://www.societopia.net/webform1.aspx allows you to load one of two simple controls (inherited from the button control) and then based on the control clicked it echoes a message indicating which one was clicked. Show quoteHide quote "Terry Minvielle via DotNetMonster.com" wrote: > I read with great attention the msdn article on "an Extensive Examination > of User Controls". > However, it did not help me solve the following problem: > > I need to populate a place holder with one a several controls which contain > a submit button. > When the parent aspx page loads, I need to load a particular server control > into the placeholder. Then I wish to capture, bubble up, the controls > submit event to the parent.aspx. Using the > > If IsPostBack Then > Response.Write(Page.Request.Form.GetValues("__EVENTTARGET")(0)) > End If > displays nothing, I guess meening that parent postback event was not > trigered by the submit in the control. > > The control contains... > > Public Event MySubmit(ByVal sender As Object, ByVal e As System.EventArgs) > > Protected Sub btSubmit_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles btSubmit.Click > RaiseEvent MySubmit(sender, Nothing) > End Sub > > Question: How can I, in the parent aspx page tell that btSubmit in control > A was clicked, or control B, etc.... > > Thanks > Terry > > -- > Message posted via DotNetMonster.com > http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-web-controls/200505/1 >
Error: Cannot use a leading .. to exit above the top directory.
DROPDOWNLIST SELECTEDINDEXCHANGED order of usercontrols processed by events of page HTMLInputFile Control for Multiple Files How do I create an Unordered List (UL) with ASP.NET? Submit form ASP.NET Server Controls not displayed in IE How to diisable textbox in datagrid Infragistics Web Control Report & Sub Report |
|||||||||||||||||||||||