Compiler Error Message: CS1061: does not contain a definition

Last Reply 11 days ago By pandeyism

Posted 11 days ago

Dear sir,

I have a usual error in my all pages. namely button control, Image button control etc. Below the error 

 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: CS1061: 'ASP.user_forgotpassword_aspx' does not contain a definition for 'ImageButton1_Click1' and no extension method 'ImageButton1_Click1' accepting a first argument of type 'ASP.user_forgotpassword_aspx' could be found (are you missing a using directive or an assembly reference?) Source Error:

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" Height="30px" ImageUrl="~/Images/applybtn.jpg"
 Width="60px" OnClick="ImageButton1_Click1" />

 

Posted 11 days ago

Hi rajeesh,

You have to make sure you have created  onclick event of ImageButton so that event should be generated in code behind.

Refer below code.

protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
{

}