S
sellars.paul
Hello,
I have a simple composite control (asp.net 1.1). The on click event
fires the first time the button is clicked but not on subsequest
clicks. Any ideas why please?
Imports System.ComponentModel
Imports System.Collections.Specialized
Imports System.Web.UI
Imports System.Web
Imports System.Web.UI.WebControls
Imports Microsoft.ContentManagement.Common
Imports Microsoft.ContentManagement.Publishing
Imports System.Web.UI.WebControls.WebControl
Imports Microsoft.ContentManagement.WebControls.Design
Imports Microsoft.ContentManagement.WebControls
Inherits Control
Implements INamingContainer
Private _SearchTerm As TextBox
Private _GoSearch As Button
Protected Overrides Sub createchildcontrols()
Controls.Clear()
_GoSearch = New Button
_SearchTerm = New TextBox
_SearchTerm.ID = "searchtermID"
_GoSearch.Text = "Go Search"
_GoSearch.ID = "mysearchID"
With Me.Controls
.Add(_SearchTerm)
.Add(_GoSearch)
End With
AddHandler _GoSearch.Click, New EventHandler(AddressOf
Me.OnSearchClick)
ensurechildcontrols()
End Sub
Private Sub OnSearchClick(ByVal sender As Object, ByVal e As
EventArgs)
Dim buttonclicked As String
buttonclicked = _SearchTerm.Text
End Sub
There is then a render
Protected Overrides Sub Render(ByVal output As
System.Web.UI.HtmlTextWriter)
that includes the lines:
_SearchTerm.RenderControl(output)
_GoSearch.RenderControl(output)
Regards,
Paul
I have a simple composite control (asp.net 1.1). The on click event
fires the first time the button is clicked but not on subsequest
clicks. Any ideas why please?
Imports System.ComponentModel
Imports System.Collections.Specialized
Imports System.Web.UI
Imports System.Web
Imports System.Web.UI.WebControls
Imports Microsoft.ContentManagement.Common
Imports Microsoft.ContentManagement.Publishing
Imports System.Web.UI.WebControls.WebControl
Imports Microsoft.ContentManagement.WebControls.Design
Imports Microsoft.ContentManagement.WebControls
Public Class TopNavMenuComp
Inherits Control
Implements INamingContainer
Private _SearchTerm As TextBox
Private _GoSearch As Button
Protected Overrides Sub createchildcontrols()
Controls.Clear()
_GoSearch = New Button
_SearchTerm = New TextBox
_SearchTerm.ID = "searchtermID"
_GoSearch.Text = "Go Search"
_GoSearch.ID = "mysearchID"
With Me.Controls
.Add(_SearchTerm)
.Add(_GoSearch)
End With
AddHandler _GoSearch.Click, New EventHandler(AddressOf
Me.OnSearchClick)
ensurechildcontrols()
End Sub
Private Sub OnSearchClick(ByVal sender As Object, ByVal e As
EventArgs)
Dim buttonclicked As String
buttonclicked = _SearchTerm.Text
End Sub
There is then a render
Protected Overrides Sub Render(ByVal output As
System.Web.UI.HtmlTextWriter)
that includes the lines:
_SearchTerm.RenderControl(output)
_GoSearch.RenderControl(output)
Regards,
Paul