error: does not contain definition

I have a input box and an image button:

<td>

<formrunat="server">

Search<asp:TextBoxID="SearchTextBox"runat="server"Height="15px"Width="150px"></asp:TextBox>

<asp:ImageButtonID="SearchImageButton"runat="server"ImageAlign="Middle"ImageUrl="~/images/go.gif"OnClick="SearchImageButton_Click"/>

</form>

</td>

I'm using the onclick event handler to pass the value from the textbox in a querystring:

protectedvoid SearchImageButton_Click(object sender,ImageClickEventArgs e)

{

Response.Redirect("http://search.compasslearning.com:9000/cgi-bin/query?mss=search&op=x&i=CompassLearning&9=" +this.SearchTextBox.Text);

}

When I run the application I get the following error message:

ASP.mainmaster.master does not contain a definition for 'SearchImageButton_Click'

Where did I go wrong?

[3437 byte] By [-D-] at [2008-2-24]
# 1
To me at a first glance, looks like you dont have the SearchImageButton_Click event created/instansiated in your codebehind page
ahmedilyas at 2007-8-30 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 2

This is the full code in my code-behind:

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class Template : System.Web.UI.MasterPage

{

protected void Page_Load(object sender, EventArgs e)

{

}

protected void SearchImageButton_Click(object sender, ImageClickEventArgs e)

{

Response.Redirect("http://search.compasslearning.com:9000/cgi-bin/query?mss=search&op=x&i=CompassLearning&9=" + this.SearchTextBox.Text);

}

}

Is this incorrect?

-D- at 2007-8-30 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 3

I think so.

I am assuming the SearchImageButton is an image button (looks like it)

are you able to double click on the button to make an event for it? can you see the event being created?

ahmedilyas at 2007-8-30 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 4

I'm just learning asp.net, so I apologize for any novice answer here.

It is an image button.

I double clicked on the image button from the designer view and it created the following code between the script tags in source view:

protected void SearchImageButton_Click(object sender, ImageClickEventArgs e)

{

}

I moved the event handler to the code-behind file and added the additional code:

protected void SearchImageButton_Click(object sender, ImageClickEventArgs e)

{

Response.Redirect("http://search.compasslearning.com:9000/cgi-bin/query?mss=search&op=x&i=CompassLearning&9=" + this.SearchTextBox.Text);

}

I'm using Visual Web Developer 2005 Express Edition

-D- at 2007-8-30 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...