Problems Getting Started

Hello,

I am using a recommended book on ASP.NET and already having problems with my
first example..here is the code:
<%@ Page Language="VB" %>
<script runat="server">
sub Page_Load(obj as object, e as eventargs)
lblMessage.Text = "Welcome to ASP.NET!"
end sub
</script>
<html>
<body>
<asp:Label id="lblMessage" runat="server"/>
</body>
</html>
when I try to view it on a web page, I get an error:
Line: 4
Char: 9
Error: Expected ';'
Code: 0
Suggestions?
Thanks,
Brian
0
brianwolters
1/14/2005 4:30:23 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

3 Replies
793 Views

Similar Articles

[PageSpeed] 47

Looks like you are missing the closing tag for the asp label.

<asp:Label id="lblMessage" runat="server">
</asp:Label>
Zath
0
Zath
1/14/2005 5:11:05 PM
You should never receive a "Expected ';'  in VB.

My guess is your solution or project is set to C# Web Application. Check your configuration.
In C#, the line -- lblMessage.Text = "Welcome to ASP.NET!" -- would error out because it is missing it's end of statement character... ;

Hope this helps.
Paul B
0
Gnome108
1/14/2005 6:21:17 PM
Zath -- He does escape the label correctly with the / before the closing tag.  If it is not a collection of items, this escape sequence is allowed. 

Happy Friday to all.
Paul B
0
Gnome108
1/14/2005 6:22:50 PM
Reply: