473,748 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need with Error Message

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.asp x" 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
Nov 19 '05 #1
25 1924
Suspect you need lang="vb" in your script tag - the ; is javascript and
may be your default client side language setting!

"Mark" <Ma**@discussio ns.microsoft.co m> wrote in message
news:30******** *************** ***********@mic rosoft.com...
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.asp x" 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

Nov 19 '05 #2
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
------------------------
Nov 19 '05 #3
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(Objec t 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
"Brian Brown" wrote:
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
------------------------

Nov 19 '05 #4
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?

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

"Mark" <Ma**@discussio ns.microsoft.co m> wrote in message
news:30******** *************** ***********@mic rosoft.com...
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.asp x" 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


Nov 19 '05 #5
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(Objec t obj, EventArgs e)
{
lblMessage.Text = "Welcome to ASPNet!";
}
</script>
<html>
<body>
<asp:Label id="lblMessage " runat="server"/>
</body>
</html>
Nov 19 '05 #6
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(Objec t 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
===========
"Mark" <Ma**@discussio ns.microsoft.co m> wrote in message
news:E8******** *************** ***********@mic rosoft.com...
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(Objec t 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
"Brian Brown" wrote:
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
------------------------

Nov 19 '05 #7
Brian -

Unfortunately, I get the same error as before...

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

Thank you for your help.

Mark
Nov 19 '05 #8
Juan -

I get the same error before.

MArk
Nov 19 '05 #9
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
===========
"Mark" <Ma**@discussio ns.microsoft.co m> wrote in message
news:E2******** *************** ***********@mic rosoft.com...
Juan -

I get the same error before.

MArk



Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3056
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers to have an easier time understanding what I do. Therefore this weekend I'm going to spend 3 days just writing comments. Before I do it, I thought I'd ask other programmers what information they find useful. Below is a typical class I've...
6
6328
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334, column 13: there is no attribute "SRC" <bgsound src="C:\My Documents\zingwent.mids"> You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is...
2
1997
by: CSDunn | last post by:
Hello, I need some assistance with error handling in an Access 2003 Project form. The project is has a data source connection to a SQL Server 2000 database. The main form is named ‘frmSelectByTest', and its subform's ‘Name' and ‘Source Object' properties are ‘frmSelectByTestSub'. The ‘Default View' on the main form is ‘Single Form', and on the sub form is ‘Continuous Forms'. The users select the name of a test (uniquely identified by a...
1
323
by: Marco Krechting | last post by:
Hi All, This is a response on my earlier posting about trapping the standard access error message when you click on a hyperlink field and the file cannot be found. I know now how to work on the field to use multiple hyperlink bases but I still need a way to get rit of this error message. Can I have a error trap at form level? Or is there another way of dealing with it?
7
3306
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte buffer into the character pointer. The code looks like the following: #include <stdio.h> #include <stdlib.h> #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call,
4
1927
by: Tressa | last post by:
I have a messagebox that I only want to pop up only if it is not already being displayed on the screen. My code is still poping up the messagebox even though it is on the screen. What am I doing wrong here. Any suggestions on how to fix this using System; using System.Collections; using System.ComponentModel;
2
1603
by: Charles | last post by:
I need to find a way to share information between two classes, one is an employee class and the other is a custom error class that inherits from ApplicationException. These two classes are part of a ClassLibrary project. The other project has all the web page classes. My project allows employees to log in using Forms Auth, I do some checking on the person that is logging in and then after that is good I create an employee object and...
12
5342
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
1
2526
by: tccode97 | last post by:
Hi, I need an urgent help. I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link http://msdn2.microsoft.com/en-us/library/system.net.sockets.udpclient...
5
7961
by: Chuck Anderson | last post by:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC (Windows XP). One of the scripts that I run daily needs to access a secure URL (https://..............). When I am running Php4, it can open the file. However, when I run Php5 I (now) get this error message: "Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?" This is new. Last time I messed with this, I merely got:
0
9552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9326
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.