all groups > dotnet academic > july 2003 >
You're in the

dotnet academic

group:

Method not found: Void System.EventHandler..ctor(System.Object, IntPtr).


Method not found: Void System.EventHandler..ctor(System.Object, IntPtr). zee
7/17/2003 5:57:57 AM
dotnet academic:
Hi!
While trying to run my first web application using
Microsost Visual Studio .net I came up with the following
error:
Method not found: Void System.EventHandler..ctor
(System.Object, IntPtr).
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.MissingMethodException: Method
not found: Void System.EventHandler..ctor(System.Object,
IntPtr).

Source Error:


Line 32: // CODEGEN: This call is
required by the ASP.NET Web Form Designer.
Line 33: //
Line 34: InitializeComponent();
Line 35: base.OnInit(e);
Line 36: }

The application is meant to do the following: CLick a
buuton and a msg in a textbox appears (typical hello world
scenario) the problem is I dont know what is wrong the
code is attached below:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace HelloWorld
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected
System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Label
Label1;
protected System.Web.UI.WebControls.Button
buthead;

private void Page_Load(object sender,
System.EventArgs e)
{
// Put user code to initialize the
page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required
by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
this.buthead.Click += new
System.EventHandler(this.buthead_Click);
this.Load += new
System.EventHandler(this.Page_Load);

}
#endregion

private void buthead_Click(object sender,
System.EventArgs e)
{
TextBox1.Text = "Hello, Web
Forms!";

}
}
}

PLEASE HELP
Re: Method not found: Void System.EventHandler..ctor(System.Object, IntPtr). Peter van der Goes
7/17/2003 8:32:32 AM

[quoted text, click to view]

<Snip code generated by the IDE>

[quoted text, click to view]

This above is the only code you wrote, correct? Out of curiosity, I tried
the same thing and had no difficulties, so I'll start you off by suggesting
the following (I'm sure others will have better ideas):

1. Is your TextBox1.Text = ... really broken inside the literal string with
a newline?. If it is, fix that and try again. If that doesn't work...

2. Be sure you didn't modify any generated code. To be sure, create a new
project just like this one and see if the error is reproduced.

3. If the error repeats, try to repair your installation of VS.NET

HTH!

Method not found: Void System.EventHandler..ctor(System.Object, IntPtr). Andrew Downum
7/17/2003 3:13:41 PM
This kind of error occurs when you have used incorrect
syntax in your aspx file (not the codebehind). It occurs
when the aspx page cannot be compiled.

If you want further help here, send in the aspx source so
we can see where the error is, or if you want to do it
yourself, click on the "show full source" (or something
like this) link on the error page, and go to the specified
line to see what it is trying to do.

~ Andrew
[quoted text, click to view]
AddThis Social Bookmark Button