By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

Problems Getting Started

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hmmm, works for me on .NET 1.1/IIS5. For some reason, it might be
trying to execute the code as C# (not sure why, as you have the
Language= directive). You could try changing to this on line 3:
<script runat="server" Language="VB">
..
Good luck,
Daniel
http://www.danhendricks.com

Nov 19 '05 #2

P: n/a
Interesting..I changed line 3 per your suggestion and no more error but no
text on the page.

"Daniel M. Hendricks" <dm*********@despammed.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hmmm, works for me on .NET 1.1/IIS5. For some reason, it might be
trying to execute the code as C# (not sure why, as you have the
Language= directive). You could try changing to this on line 3:
<script runat="server" Language="VB">
.
Good luck,
Daniel
http://www.danhendricks.com

Nov 19 '05 #3

P: n/a
Something strange is going on there. I wonder if it's the document
encoding or something. Try saving it notepad and see if it runs.
That's all I got, sorry :P

Nov 19 '05 #4

P: n/a
Daniel M. Hendricks wrote:
Something strange is going on there. I wonder if it's the document
encoding or something. Try saving it notepad and see if it runs.
That's all I got, sorry :P


I think Brian is opening the aspx file directly through
Windows Explorer (c:\\inetpub\wwwroot\file.aspx),
instead of having it executed by a web server (through
http://localhost/file.aspx)

--

Riki
Nov 19 '05 #5

P: n/a
That's what it was..fixed now..thanks!

"Riki" <ri**@nospam.com> wrote in message
news:OC****************@TK2MSFTNGP12.phx.gbl...
Daniel M. Hendricks wrote:
Something strange is going on there. I wonder if it's the document
encoding or something. Try saving it notepad and see if it runs.
That's all I got, sorry :P


I think Brian is opening the aspx file directly through
Windows Explorer (c:\\inetpub\wwwroot\file.aspx),
instead of having it executed by a web server (through
http://localhost/file.aspx)

--

Riki

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.