Error in my first asp.net page

F

Franko

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\Temporary 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\Temporary 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\Temporary 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\Temporary 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>
 
N

Nick Malik

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
 

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

Top