Groups | Blog | Home
all groups > dotnet general > august 2004 >

dotnet general : Error in Hello World page


mscertified
8/20/2004 4:59:01 PM
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
Nick Malik
8/21/2004 8:37:30 AM
It's hard to respond to this... I just don't see a lot of folks writing code
that is embedded in the web page.

Have you looked at using WebMatrix?
http://www.asp.net/webmatrix/default.aspx?tabIndex=4&tabId=46

The good folks at asp.net may be able to provide tools and techniques that
can help you.

--- Nick

[quoted text, click to view]

Predrag
8/22/2004 4:33:02 AM
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


[quoted text, click to view]
mscertified
8/23/2004 9:37:01 AM
This was just a page in the book that verifies that .NET is working on my PC,
no other purpose.

[quoted text, click to view]
AddThis Social Bookmark Button