473,386 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

vb.net wed application on winXP Home and Cassini



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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #1
1 1980
There are a bunch of smallish typos.
This worked for me.

-Dino
Microsoft
================================================== ===
<%@ Page Language="VB" Debug="true" Trace="false" %>

<script runat="server">
Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) 'Handles MyBase.Load
'Put user code to initialize the page here
Trace.Write("Page_Load")
if (TextBox1.Text="")
TextBox1.Text = "Type your name"
end if
End Sub

Protected 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

</script>

<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="Button1" runat="server" OnClick="Button1_Click"
Text="ClickMe"></asp:Button>
</form>
</body>
</HTML>

"Alice Z." <al***********@yahoo.com> wrote in message
news:uL*************@TK2MSFTNGP09.phx.gbl...


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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alice Z. | last post by:
I have Cassini running on my windows XP Home. I am trying to create an ASP.NET application using VB.NET, but I keep on getting following error: Unable to create web project 'WebApplication1'. The...
2
by: Alice Z. | last post by:
Hi, dear I have created a vb.net web application on XP Home and expected to run it on Cassini. Cassini works fine. But When I was trying to access it using URL as: ...
1
by: Reza Sadeghi | last post by:
Hi I am getting this error when I tried to browse any asp.net in visual studio.net. I can build the project but when I try to run and debug the project I get error message that "Unable to start...
2
by: Alice Z. | last post by:
I have Cassini running on my windows XP Home. I am trying to create an ASP.NET application using VB.NET, but I keep on getting following error: Unable to create web project 'WebApplication1'. The...
2
by: Alice Z. | last post by:
Hi, dear I have created a vb.net web application on XP Home and expected to run it on Cassini. Cassini works fine. But When I was trying to access it using URL as: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.