Need with Error Message

G

Guest

I'm just starting out in an introductory ASP.Net course, and am trying to run
a simple program but keeping getting an error.

I'm running XP, have installed Internet Information Services (5.1) ,
Microsoft .Net Framework (English) v1.0.3705 and Microsoft .Net Framework SDK
(English) v1.0a on my computer. Also Visual Studio .Net 2002 is also
installed.

"http://localhost/day1/listing0104.aspx" is placed in the address line of
Browser. The following error message displays:

Line: 5
Char: 5
Error: Expected ';'
Code: 0
URL: http://localhost/day1/listing0104.aspx

The program is a follows:
<%@ Page Language="VB" %>

<script runat="server">

sub Page_Load(obj as object, e as eventargs)
lblMessage.text = "Welcome to ASPNet!"
end sub

</script>

<html><body>
<asp:Label id="lblMessage" runat="server"/>
</body></html>

My hunch is that the .Net Framework 1.1 might work better than the current
1.0v.

Any ideas as to what is causing the error?

Thank you,
Mark
 
G

Guest

Mark,

Your code looks fine to me. What is suspicious is that the ";" is a line
terminator in C#. Are you sure that you are using the VB compiler?


Hope this helps
------------------------
 
J

John Blair

Suspect you need lang="vb" in your script tag - the ; is javascript and
may be your default client side language setting!
 
G

Guest

Thanks Brian - I was thinking C++ (C++ uses ';' too).

So I tryed a C# rendition of the program. The following error came up:

Line: 3
Char: 23
Erro: expected ')'
Code: 0
URL http://localhost/day1/listing0103.aspx

C# code:
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(Object obj, EventArgs e)
{
lblMessage.text = "Welcome to ASPNet!";
}
</script>
<html><body>
<asp:Label id="lblMessage" runat="server"/>
</body></html>

Anything else come to mind?
Thanks, Mark
 
G

Guest

John -

Thanks for the comment. I inserted your suggestion as:

<script runat="server" lang="VB">

But it still gave the the same error.

Any other suggestions?
 
G

Guest

Hi Mark,

The code below has a syntax error. It is lblMessage.Text (C# is case
sensitive). I fixed that problem and pasted it in a text file named
test.aspx in the root of my web server and ran it. No problems. The code
looks fine. I have pasted my code below. Please try the same thing and see
if it works for you. If not reply to this post with the details so we can
keep diagnosing.

I hope this helps.
-------------------------------
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(Object obj, EventArgs e)
{
lblMessage.Text = "Welcome to ASPNet!";
}
</script>
<html>
<body>
<asp:Label id="lblMessage" runat="server"/>
</body>
</html>
 
J

Juan T. Llibre

You have a couple of problems:

C# is case-sensitive.

Use lblMessage.Text
instead of lblMessage.text

Also, you are missing the </asp:Label> closing tag.

Here's the corrected code.
It should work fine.


<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(Object obj, EventArgs e)
{
lblMessage.Text = "Welcome to ASPNet!";
}
</script>
<html>
<body>
<asp:Label ID="lblMessage" Runat="server" Text="Label"></asp:Label>
</body>
</html>

best regards,



Juan T. Llibre
ASP.NET MVP
===========
 
J

Juan T. Llibre

Mark,

attached are bot C# and VB.NET
versions which I *know* work.

If neither of those work,
you've got a faulty installation.




Juan T. Llibre
ASP.NET MVP
===========
 
G

Guest

Mark,

I agree with Juan. This is pretty simple code. If the code that either one
of us provided does not work you will probably need to reinstall.

Hope this helps.
 
G

Guest

I'd say I have an installation or configuration error, too.

What can I do?

What I have installed is:
IIS 5.1
..Net Framework (English) v1.0.3705
..Net Framwork SDK (English) 1.0a
Visual Studio .Net Enterprise Architect - English (2002)
 
J

Juan T. Llibre

To determine the version of the .NET Framework
on a computer that is running Microsoft Windows XP

1. Click Start, and then click Control Panel.

2. In Classic view, double-click Administrative Tools.

3. Double-click either Microsoft .NET Framework Configuration.

4. In the .NET Framework Configuration window,
click About .NET Framework Configuration on the Help menu.

The .NET Framework version number appears in the
"About .NET Framework Configuration" dialog box.

If the version number is 1.0.3705.0,
you have version 1.0 without any service packs installed.

If you don't have any .Net Framework SPs installed,
you could try installing the .NET Framework's SP3.

Download it at :

http://www.microsoft.com/downloads/...61-4a92-4106-a9bc-83e78d4abc5b&DisplayLang=en

You don't need to install SP1 nor SP2, to install SP3.

Even better, you could download .Net Framework 1.1,
and install *that*.

The .Net 1.1 redistributable is available at :
http://www.microsoft.com/downloads/...e3-f589-4842-8157-034d1e7cf3a3&DisplayLang=en
( 23 MB )

The .Net Framework 1.1 SDK is available at :
http://www.microsoft.com/downloads/...a6-3647-4070-9f41-a333c6b9181d&DisplayLang=en
(110 MB)

You should install .Net Framework 1.1 SP1,
after you install the .Net Framework 1.1 or the 1.1 SDK :

Get it from:
http://www.microsoft.com/downloads/...4f-088e-40b2-bbdb-a83353618b38&displaylang=en
( 10 MB )



Juan T. Llibre
ASP.NET MVP
===========
 
J

Juan T. Llibre

I should have added that you should uninstall
the .NET Framework 1.0 *before* installing 1.1

OK ?



Juan T. Llibre
ASP.NET MVP
===========
 
G

Guest

Juan -

I will try the 1.1 installation.

I'm guessing v1.1 will not interfere with Visual Studio .Net 2002 (which
uses .Net Framework 1.0).

Thank you for your help.

Mark
 
G

Guest

Juan,

After you get the 1.1 framwork installed please give it a try again and then
post your results. We would be very interested to see them.

Good Luck!
 
G

Guest

Mark,

After you install the framework will you please post your results of running
this page? We are very interested in seeing how it turns out.

Good Luck.
 
J

Juan T. Llibre

You should be able to run them both "side-by-side",
and still develop apps with VS.NET 2002.

For that, you would need to *not* uninstall
the .Net Framework 1.0, OK ?

If all you are looking for is to fix your .Net Framework
1.0 install and continue to use VS.NET 2002,
then you should install .Net Framework SP3.

You could also uninstall/reinstall .Net Framework 1.0,
and *then* install the .Net Framework SP3.

If you re-install VS.NET 2002,
make sure you apply SP3 afterwards.



Juan T. Llibre
ASP.NET MVP
===========
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top