473,397 Members | 2,099 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,397 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 1982
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.