Error in Hello World page

G

Guest

I just started working thru a book on ASP.NET and am trying to display their
Hello World page. Below is the page.
When I attempt to display it with IE, I get an error on line 23, 'runtime
error, expected ';'. Any clues?

<%@ Page Language="VB" %>

<html>
<head>
<title>Simple test ASP.NET page</title>
</head>
<body>
<form runat="server">
<h2>A Simple ASP.NET Page</h2>
<p>Enter your name in the box below, then click the button:</p>
<p>
<asp:TextBox id="txtNameBox" runat="server" />
<asp:Button id="btnSubmit" onclick="btnSubmit_Click"
runat="server" Text="Click Here!" />
</p>
<p>
<asp:Label id="lblMessageLabel" runat="server" />
</p>
</form>
</body>
</html>

<script runat="server">
Sub btnSubmit_Click(sender As Object, e As EventArgs)
lblMessageLabel.Text = "Hello " & txtNameBox.Text
End Sub
</script>
 
G

Guest

Just put ";" after "lblMessageLabel.Text = "Hello " & txtNameBox.Text". As
the error said (expected ';').

Like this:
Sub btnSubmit_Click(sender As Object, e As EventArgs)
Sub btnSubmit_Click(sender As Object, e As EventArgs)
lblMessageLabel.Text = "Hello " & txtNameBox.Text ;
End Sub
 
G

Guest

This was just a page in the book that verifies that .NET is working on my PC,
no other purpose.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top