Robert Chu
11-23-2009, 07:50 AM
Hello,
I put a TextBox1 and a Button1 on asp.net. When I Click the button1, I dynamically add a Textbox2 on the page. But I found when I push Enter twice in Textbox1, it will automatically execute Button1_Click. How can I avoid executing button_Click ? Thanks.
Then the code is as following:
Protected Sub Page_Load(............................)
If IsPostBack Then
Dim txtMail as New TextBox()
Me.form1.Controls.Add(txtMail)
End If
End Sub
Protected Sub Button1_Click(..........................)
Response.Write("Button1 is Clicked")
End Sub
I put a TextBox1 and a Button1 on asp.net. When I Click the button1, I dynamically add a Textbox2 on the page. But I found when I push Enter twice in Textbox1, it will automatically execute Button1_Click. How can I avoid executing button_Click ? Thanks.
Then the code is as following:
Protected Sub Page_Load(............................)
If IsPostBack Then
Dim txtMail as New TextBox()
Me.form1.Controls.Add(txtMail)
End If
End Sub
Protected Sub Button1_Click(..........................)
Response.Write("Button1 is Clicked")
End Sub