?
Solved

changing an asp:image button to a asp:button

Posted on 2008-10-30
3
Medium Priority
?
211 Views
Last Modified: 2012-05-05
I have the following:

 

 


 

 

<asp:Button CssClass="blackButton2" ID="Submit" runat="server" Text="Register" OnClick="imgRegister_Click" Font-Bold="True"


/>

it was working with OnClick before I change it to a button instead of an image button.

It does not like the onclick?
Server Error in '/OL_Web' 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: CS0123: No overload for 'imgRegister_Click' matches delegate 'System.EventHandler'

Source Error:

 

Line 293:          <td class="label" align="left" height="25">&nbsp;</td>
Line 294:          <td class="body" >
Line 295:           <asp:Button CssClass="blackButton2" ID="imgRegister" runat="server" Text="Register"  
Line 296:                  Font-Bold="True" onclick="imgRegister_Click" />
Line 297:          </td>
 


0
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22847706
Did you keep the same code-behind event handler after the change?
Image click takes an argument of type ImageClickEventArgs, instead of the simple EventArgs taken by the button.
 
0
 
LVL 7

Accepted Solution

by:
lakshmidurga earned 2000 total points
ID: 22847763
You need to change the button click event too in code behind page.

When you use imabage button the onclick event will be
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
****************Your code***********
    End Sub

when you use normal button your code will look like
 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
*******************Your code*************
    End Sub
0
 

Author Comment

by:mathieu_cupryk
ID: 22849991
excellent lak.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This article will show, step by step, how to integrate R code into a R Sweave document
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question