First asp.net error. Pl help

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>
 
M

Mas jabier

<%@ Page language="c#" Codebehind="WebForm2.aspx.cs"
AutoEventWireup="false"
Inherits="WebApplication1.WebForm2" %>

+ where is your code behind - >WebForm2.aspx.cs ??? I
cannot found it here. Check again syntax in your code
behind files

+ if you are not gonna use code behind (instead of using
visual tools, you like to just hands in on Notepad, then
it should be like this) :

-- delete this lines --
<%@ 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>

--change to this ------------------------------------------
protected void WebForm2_Load(Object 0, EventArgs e){
Response.Write("Message from Load Event Handler
}
protected void WebForm2_Init(Object 0, EventArgs e){
Response.Write("Message from Init Event Handler
}

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

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>

Hope this helps :)

Jody Ananda
MCAD.NET,MCSD.NET
"All programs are poems, it just not all programmers are
poets."



-----Original Message-----
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
ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0.cs (93,25): error
CS1518: Expected class, delegate, enum, interface, or struct
ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0.cs (173,25): error
CS1518: Expected class, delegate, enum, interface, or struct
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
}
protected void WebForm2_Init(Object 0, EventArgs e){
Response.Write("Message from Init Event Handler
 

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,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top