Board index » Web Programming » I keep getting this error. pl help

I keep getting this error. pl help

Web Programming436
I get the following error. Ihave no idea why? Pl help

Server Error in '/WebApplication1' Application.

--------------------------------------------------------------------------------



Compilation Error

Description: An error occurred during the compilation of a resource

required to service this request. Please review the following specific

error details and modify your source code appropriately.



Compiler Error Message: CS0246: The type or namespace name

'EventHander' could not be found (are you missing a using directive or

an assembly reference?)



Source Error:







Line 16:

Line 17: protected override void OnInit(EventArgs e){

Line 18: this.Load+= new EventHander(WebForm2_Load);

Line 19: this.PreRender +=new EventHander(WebForm2_Init);

Line 20: this.Init +=new EventHander(WebForm2_Render);





Source File: http://localhost/WebApplication1/WebForm2.aspx Line:

18











<%@ 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 o, EventArgs e){

Response.Write("Message from Load Event Handler <br>");

}

protected void WebForm2_Init(Object o, EventArgs e){

Response.Write("Message from Init Event Handler <br>");

}



protected void WebForm2_PreRender(Object o,EventArgs e){

Response.Write("Message from PreRender Event Handler <br>");

}



protected override void OnInit(EventArgs e){

this.Load+= new EventHander(WebForm2_Load);

this.PreRender +=new EventHander(WebForm2_Init);

this.Init +=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="schemas.microsoft.com/intellisense/ie5">

</head>

<body MS_POSITIONING="GridLayout">



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









</form>



</body>

</html>


-
 

Re:I keep getting this error. pl help

This is very odd indeed.

I'm wondering if its a studio bug or if you accidentally deleted all the

'l's in the word Handler? The key word is New Handler not new Hander which

is the reason for the compiler error. But it is likely not a delete error

because lines 18 thru 20 have the same error. Could you have replaced them

all by accident?



--

Regards,

Alvin Bruney

Got DotNet? Get it here

home.networkip.net/dotnet/tidbits/default.htm">home.networkip.net/dotnet/tidbits/default.htm

"Franko" <junkone@sympatico.ca>wrote in message

Quote
I get the following error. Ihave no idea why? Pl help

Server Error in '/WebApplication1' Application.

--------------------------------------------------------------------------

------



Compilation Error

Description: An error occurred during the compilation of a resource

required to service this request. Please review the following specific

error details and modify your source code appropriately.



Compiler Error Message: CS0246: The type or namespace name

'EventHander' could not be found (are you missing a using directive or

an assembly reference?)



Source Error:







Line 16:

Line 17: protected override void OnInit(EventArgs e){

Line 18: this.Load+= new EventHander(WebForm2_Load);

Line 19: this.PreRender +=new EventHander(WebForm2_Init);

Line 20: this.Init +=new EventHander(WebForm2_Render);





Source File: http://localhost/WebApplication1/WebForm2.aspx Line:

18











<%@ 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 o, EventArgs e){

Response.Write("Message from Load Event Handler <br>");

}

protected void WebForm2_Init(Object o, EventArgs e){

Response.Write("Message from Init Event Handler <br>");

}



protected void WebForm2_PreRender(Object o,EventArgs e){

Response.Write("Message from PreRender Event Handler <br>");

}



protected override void OnInit(EventArgs e){

this.Load+= new EventHander(WebForm2_Load);

this.PreRender +=new EventHander(WebForm2_Init);

this.Init +=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="schemas.microsoft.com/intellisense/ie5">">schemas.microsoft.com/intellisense/ie5">

</head>

<body MS_POSITIONING="GridLayout">



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









</form>



</body>

</html>





-

Re:I keep getting this error. pl help

Quote
this.Load+= new EventHander(WebForm2_Load);

this.PreRender +=new EventHander(WebForm2_Init);

this.Init +=new EventHander(WebForm2_Render);



I think Alvin hit this one. Notice that it says EventHander when it should

include an "l" as in



this.Load += new System.EventHandler(this.Page_Load);





"Franko" <junkone@sympatico.ca>wrote in message

Quote
I get the following error. Ihave no idea why? Pl help

Server Error in '/WebApplication1' Application.

--------------------------------------------------------------------------------



Compilation Error

Description: An error occurred during the compilation of a resource

required to service this request. Please review the following specific

error details and modify your source code appropriately.



Compiler Error Message: CS0246: The type or namespace name

'EventHander' could not be found (are you missing a using directive or

an assembly reference?)



Source Error:







Line 16:

Line 17: protected override void OnInit(EventArgs e){

Line 18: this.Load+= new EventHander(WebForm2_Load);

Line 19: this.PreRender +=new EventHander(WebForm2_Init);

Line 20: this.Init +=new EventHander(WebForm2_Render);





Source File: http://localhost/WebApplication1/WebForm2.aspx Line:

18











<%@ 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 o, EventArgs e){

Response.Write("Message from Load Event Handler <br>");

}

protected void WebForm2_Init(Object o, EventArgs e){

Response.Write("Message from Init Event Handler <br>");

}



protected void WebForm2_PreRender(Object o,EventArgs e){

Response.Write("Message from PreRender Event Handler <br>");

}



protected override void OnInit(EventArgs e){

this.Load+= new EventHander(WebForm2_Load);

this.PreRender +=new EventHander(WebForm2_Init);

this.Init +=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="schemas.microsoft.com/intellisense/ie5">">schemas.microsoft.com/intellisense/ie5">

</head>

<body MS_POSITIONING="GridLayout">



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









</form>



</body>

</html>



-

Re:I keep getting this error. pl help

Thanks a million...



"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca>wrote in message news:<OmcKKQazDHA.560@TK2MSFTNGP11.phx.gbl>...

Quote
>this.Load+= new EventHander(WebForm2_Load);

>this.PreRender +=new EventHander(WebForm2_Init);

>this.Init +=new EventHander(WebForm2_Render);



I think Alvin hit this one. Notice that it says EventHander when it should

include an "l" as in



this.Load += new System.EventHandler(this.Page_Load);





"Franko" <junkone@sympatico.ca>wrote in message

news:ece5b5.0312270304.434fc119@posting.google.com...

>I get the following error. Ihave no idea why? Pl help

>Server Error in '/WebApplication1' Application.

>--------------------------------------------------------------------------------

>

>Compilation Error

>Description: An error occurred during the compilation of a resource

>required to service this request. Please review the following specific

>error details and modify your source code appropriately.

>

>Compiler Error Message: CS0246: The type or namespace name

>'EventHander' could not be found (are you missing a using directive or

>an assembly reference?)

>

>Source Error:

>

>

>

>Line 16:

>Line 17: protected override void OnInit(EventArgs e){

>Line 18: this.Load+= new EventHander(WebForm2_Load);

>Line 19: this.PreRender +=new EventHander(WebForm2_Init);

>Line 20: this.Init +=new EventHander(WebForm2_Render);

>

>

>Source File: http://localhost/WebApplication1/WebForm2.aspx Line:

>18

>

>

>

>

>

><%@ 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 o, EventArgs e){

>Response.Write("Message from Load Event Handler <br>");

>}

>protected void WebForm2_Init(Object o, EventArgs e){

>Response.Write("Message from Init Event Handler <br>");

>}

>

>protected void WebForm2_PreRender(Object o,EventArgs e){

>Response.Write("Message from PreRender Event Handler <br>");

>}

>

>protected override void OnInit(EventArgs e){

>this.Load+= new EventHander(WebForm2_Load);

>this.PreRender +=new EventHander(WebForm2_Init);

>this.Init +=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="schemas.microsoft.com/intellisense/ie5">">schemas.microsoft.com/intellisense/ie5">

></head>

><body MS_POSITIONING="GridLayout">

>

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

>

>

>

>

></form>

>

></body>

></html>

-