Shaitan00 Posted May 25, 2004 Posted May 25, 2004 Given a web form with an Image Button and Link Button, both, when clicked, will re-direct the user to the main.aspx web form. To achieve this goal I wanted to have both the Image Button and Link Button using the same function [OnClick = �Enter_Click� in html] which I created as �public void Enter_Click(object sender, System.EventArgs e)� which generated the following error, �Method 'TEST.WebForm1.Enter_Click(object, System.EventArgs)' does not match delegate 'void System.Web.UI.ImageClickEventHandler(object, System.Web.UI.ImageClickEventArgs)'� for the image button. However if I use the one provided above it fails for my link button instead with a similar error except requested that I use �System.EventArgs e�, is there no way to do this in one function or must I write 2 separate ones, one for the Image Button and one for the Link Button (with the only difference being the Event Argument passed in)? Quote
wessamzeidan Posted May 25, 2004 Posted May 25, 2004 Why don't you write one function that does your work and call it in two event handlers???? Quote Proudly a Palestinian Microsoft ASP.NET MVP My Blog: wessamzeidan.net
Shaitan00 Posted May 25, 2004 Author Posted May 25, 2004 Not 100% sure what you mean, isn't that what I am currently trying to do? Can you provide an example? Quote
wessamzeidan Posted May 25, 2004 Posted May 25, 2004 private function myfunction() 'do your stuff here end function call this function in the eventhandlers of your imagebutton and linkbutton Quote Proudly a Palestinian Microsoft ASP.NET MVP My Blog: wessamzeidan.net
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.