G
Guest
I'm trying to process the Onclick event of my page but it's never working. The button is dynamical added to the sites MainPanel.
If I click the button on the page the Page_Load Event() is processed during the postback but not the Sub Button_Click.
Where is my mistake
Thanks for hints and ideas
Steve
Here is my example code
Public Class WebForm
Inherits System.Web.UI.Pag
#Region " Web Form Designer Generated Code
'This call is required by the Web Form Designer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent(
End Su
Protected WithEvents MainPanel As System.Web.UI.WebControls.Pane
'NOTE: The following placeholder declaration is required by the Web Form Designer
'Do not delete or move it
Private designerPlaceholderDeclaration As System.Objec
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Ini
'CODEGEN: This method call is required by the Web Form Designe
'Do not modify it using the code editor
InitializeComponent(
End Su
#End Regio
Protected WithEvents Button As New System.Web.UI.WebControls.Butto
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
If Not IsPostBack The
Design_Page(
End I
End Su
Private Sub Design_Page(
Button.ID = "Button
Button.Style.Add("position", "absolute"
Button.Width = Unit.Pixel(30
Button.Height = Unit.Pixel(30
MainPanel.Controls.Add(Button
End Su
Private Sub Button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Button.Clic
End Su
End Class
If I click the button on the page the Page_Load Event() is processed during the postback but not the Sub Button_Click.
Where is my mistake
Thanks for hints and ideas
Steve
Here is my example code
Public Class WebForm
Inherits System.Web.UI.Pag
#Region " Web Form Designer Generated Code
'This call is required by the Web Form Designer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent(
End Su
Protected WithEvents MainPanel As System.Web.UI.WebControls.Pane
'NOTE: The following placeholder declaration is required by the Web Form Designer
'Do not delete or move it
Private designerPlaceholderDeclaration As System.Objec
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Ini
'CODEGEN: This method call is required by the Web Form Designe
'Do not modify it using the code editor
InitializeComponent(
End Su
#End Regio
Protected WithEvents Button As New System.Web.UI.WebControls.Butto
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
If Not IsPostBack The
Design_Page(
End I
End Su
Private Sub Design_Page(
Button.ID = "Button
Button.Style.Add("position", "absolute"
Button.Width = Unit.Pixel(30
Button.Height = Unit.Pixel(30
MainPanel.Controls.Add(Button
End Su
Private Sub Button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Button.Clic
End Su
End Class