473,513 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error in my first asp.net page

I get the following error. Please help

c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6 ,38): error CS1001:
Identifier expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6 ,52): error CS1002:
; expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(7 ,19): error CS1519:
Invalid token '(' in class, struct, or interface member declaration
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(9 ,2): error CS0116: A
namespace does not directly contain members such as fields or methods
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(69,16): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(93,25): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(173,25): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(177,1): error
CS1022: Type or namespace definition, or end-of-file expected

<%@ Page language="c#" Codebehind="WebForm2.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.WebForm2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html>
<head><script runat=server>
protected void WebForm2_Load(Object 0, EventArgs e){
Response.Write("Message from Load Event Handler <br>");
}
protected void WebForm2_Init(Object 0, EventArgs e){
Response.Write("Message from Init Event Handler <br>");
}

protected void WebForm2_PreRender(Object 0,EventArgs e){
Response.Write("Message from PreRender Event Handler <br>");
}

protected override void OnInit(EventArgs e){
this.load new EventHander(WebForm2_Load);
this.load new EventHander(WebForm2_Init);
this.load new EventHander(WebForm2_Render);
base.OnInit(e);

}
</script>

<title>WebForm2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">

<form id="Form1" method="post" runat="server">


</form>

</body>
</html>
Nov 15 '05 #1
1 10294
Hello,

In your definitions, you are using the digit zero ('0') in a place where a
variable name is expected.
protected void WebForm2_Load(Object 0, EventArgs e){
should become
protected void WebForm2_Load(Object o, EventArgs e){
Many of the remaining errors are cascading errors from this one. You made
this error in each of your declarations.

Hope this helps,
--- Nick

"Franko" <ju*****@sympatico.ca> wrote in message
news:ec************************@posting.google.com ... I get the following error. Please help

c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6 ,38): error CS1001:
Identifier expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6 ,52): error CS1002:
; expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(7 ,19): error CS1519:
Invalid token '(' in class, struct, or interface member declaration
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(9 ,2): error CS0116: A
namespace does not directly contain members such as fields or methods
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(69,16): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(93,25): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(173,25): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(177,1): error
CS1022: Type or namespace definition, or end-of-file expected

<%@ Page language="c#" Codebehind="WebForm2.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.WebForm2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html>
<head><script runat=server>
protected void WebForm2_Load(Object 0, EventArgs e){
Response.Write("Message from Load Event Handler <br>");
}
protected void WebForm2_Init(Object 0, EventArgs e){
Response.Write("Message from Init Event Handler <br>");
}

protected void WebForm2_PreRender(Object 0,EventArgs e){
Response.Write("Message from PreRender Event Handler <br>");
}

protected override void OnInit(EventArgs e){
this.load new EventHander(WebForm2_Load);
this.load new EventHander(WebForm2_Init);
this.load new EventHander(WebForm2_Render);
base.OnInit(e);

}
</script>

<title>WebForm2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">

<form id="Form1" method="post" runat="server">


</form>

</body>
</html>

Nov 15 '05 #2

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

Similar topics

6
5426
by: user | last post by:
when i first load index.php with arguments ie: "index.php?page=x", the $_SERVERvalue is null. I then get the session id appended to each link. If i refresh the page, I get the $_SERVER I want, but...
9
3440
by: Jacquie | last post by:
hello- I am hoping someone can help me solve this mystery. My pages always say Done with error on page on the bottom. They appear fine on my computer but other people can't all see it on their...
6
3554
by: John Lau | last post by:
Hi, I am looking at the MS KB Article 306355: HOW TO: Create Custom Error Reporting Pages in ASP.NET by Using Visual C# .NET This article describes how to redirect errors to a custom html...
2
2112
by: david | last post by:
Problem: There is a search button, Search, in form, for searching patient info list. The error occurs after the following steps: 1. search first time is OK, and all found the records are...
3
2315
by: Mesut | last post by:
I have written a form in with radio buttons the name is set to orderby and the value is set to KundeVorName and the next value is KundeNachName and it goes so on. I wanna modify my query according...
4
2248
by: JavaDev | last post by:
When i am trying to display progress bar using javascript with the first page load of my application i was getting an error with IE "internet Explorer cannot open this site " how to get rid...
6
2137
by: cmrchs | last post by:
Hello, I have set the Allowpaging property to true in a standard DataGrid- control (System.Web.UI.WebControls). when run in the browser i get the first records in the first page, there are 5...
4
3552
by: ArizonaJohn | last post by:
Hello, The code below works great. The user enters a name into an HTML form, the code looks up a table with that name, and then that table is displayed. I am trying to use pagination with it,...
0
1267
by: gershwyn | last post by:
I am trying to set the footer on the first page of an Excel spreadsheet through VBA (in Access 2007.) I have set the DifferentFirstPageHeaderFooter property to true, and header and footer for...
6
5212
sueb
by: sueb | last post by:
I'm implementing a report that has an entirely different first page than the rest of the pages (the first page gets printed on an original form, but the following pages have their much-more-simple...
0
7264
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7386
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,...
0
7543
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...
1
7106
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...
0
7534
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5094
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...
0
3236
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...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
459
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...

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.