I am new to asp.net stuff and I am pretty confused on how to fix this problem. I have the back code written for everything and right now I am just making everything "look pretty". Originally I had an ASP button to submit a form for something. Now I want the button to be an ASP ImageButton. However now my method is returning an error due to this change. This is what it looks like:
//.ascx file
<div id="eSubmit">
<asp:ImageButton id="btnSubmit1" runat="server" ImageUrl="~/Style/Images/addButtonE.png" />
</div>
//method behind
void btnSubmit_Click(object sender, EventArgs e)
{
if (!Page.IsValid) { return; }
try
{
//do some data checking
//bind entries
}
catch (ApplicationException ax)
{
;
}
}
The error that is generated after changing the button to imagebutton is:
Cannot convert 'System.EventHandler' to 'System.Web.UI.ImageClickEventHandler'
So my main question is: How do I fix this error? And will this effect the data I am sending to the server in anyway (will this cause different behavior then when it was just a button)?