By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,357 Members | 1,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,357 IT Pros & Developers. It's quick & easy.

I keep getting this error. pl help

P: n/a
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="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">

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


</form>

</body>
</html>
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
http://home.networkip.net/dotnet/tidbits/default.htm
"Franko" <ju*****@sympatico.ca> wrote in message
news:ec************************@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="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">

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


</form>

</body>
</html>

Nov 18 '05 #2

P: n/a
>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" <ju*****@sympatico.ca> wrote in message
news:ec************************@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="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">

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


</form>

</body>
</html>


Nov 18 '05 #3

P: n/a
Thanks a million...

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message news:<Om*************@TK2MSFTNGP11.phx.gbl>...
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" <ju*****@sympatico.ca> wrote in message
news:ec************************@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="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">

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


</form>

</body>
</html>

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.