A
Alice Z.
Hi,
I have created a very simple web page using vb.net. Unfortunately, it
seems my vs.net can not generate correct HTML code based on my vb code
(it doesn’t handle the load and click event). The vb code and related
HTML code are as follows:
.net generated Vb code:
Public Class Hello
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
...
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
TextBox1.Text = "Type your name"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Label1.Text = "hello, " & TextBox1.Text & "!"
TextBox1.Visible = False
Button1.Visible = False
End Sub
End Class
.net generated HTML code:
<HTML>
…
<body>
<form id = “Form1” method = “post” runat = “server”>
<asp: Label id = “Label1” runat = “server”>Enter a name</asp:
Label>
<asp:TextBox id==“TextBox1” runat=“server’></asp:TextBox>
<asp:Button id=“Botton1” runat=“server”></asp:Button>
</form>
</body>
</HTML>
Could anyone tell me where is wrong?
Thanks
Alice
I have created a very simple web page using vb.net. Unfortunately, it
seems my vs.net can not generate correct HTML code based on my vb code
(it doesn’t handle the load and click event). The vb code and related
HTML code are as follows:
.net generated Vb code:
Public Class Hello
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
...
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
TextBox1.Text = "Type your name"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Label1.Text = "hello, " & TextBox1.Text & "!"
TextBox1.Visible = False
Button1.Visible = False
End Sub
End Class
.net generated HTML code:
<HTML>
…
<body>
<form id = “Form1” method = “post” runat = “server”>
<asp: Label id = “Label1” runat = “server”>Enter a name</asp:
Label>
<asp:TextBox id==“TextBox1” runat=“server’></asp:TextBox>
<asp:Button id=“Botton1” runat=“server”></asp:Button>
</form>
</body>
</HTML>
Could anyone tell me where is wrong?
Thanks
Alice