I keep getting this error. pl help

F

Franko

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

Alvin Bruney

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?
 
K

Ken Cox [Microsoft MVP]

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);
 
F

Franko

Thanks a million...

Ken Cox said:
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);
 

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,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top