By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,696 Members | 1,424 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,696 IT Pros & Developers. It's quick & easy.

Same function different signatures

P: n/a
I have a function that I want to jump to from 2 different controls
(ImageButton and LinkButton).

The problem is I get the error:

Method 'Public Sub PrintPage_Click(sender As Object, e As
System.Web.UI.ImageClickEventArgs)' does not have the same signature as
delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)

Is there a way to call the same function from these 2 buttons?

Thanks,

Tom
May 17 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Put all the logic that does the printing into its own function. Then call it
from both of the event handlers.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:u%****************@TK2MSFTNGP05.phx.gbl...
I have a function that I want to jump to from 2 different controls
(ImageButton and LinkButton).

The problem is I get the error:

Method 'Public Sub PrintPage_Click(sender As Object, e As
System.Web.UI.ImageClickEventArgs)' does not have the same signature as
delegate 'Delegate Sub EventHandler(sender As Object, e As
System.EventArgs)

Is there a way to call the same function from these 2 buttons?

Thanks,

Tom

May 17 '06 #2

P: n/a
That's what I thought.

I was hoping to do it from one function.

Thanks,

Tom
"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:OC**************@TK2MSFTNGP05.phx.gbl...
Put all the logic that does the printing into its own function. Then call
it from both of the event handlers.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:u%****************@TK2MSFTNGP05.phx.gbl...
I have a function that I want to jump to from 2 different controls
(ImageButton and LinkButton).

The problem is I get the error:

Method 'Public Sub PrintPage_Click(sender As Object, e As
System.Web.UI.ImageClickEventArgs)' does not have the same signature as
delegate 'Delegate Sub EventHandler(sender As Object, e As
System.EventArgs)

Is there a way to call the same function from these 2 buttons?

Thanks,

Tom


May 17 '06 #3

P: n/a
Why? Does it really matter?

You could change the PrintPage_Click method to have just EventArgs as the
second argument, which will be fine as long as you are not using any of the
information in the arguments you have now.

But in reality, it's not even worth doing. Creating another method is
trivial.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:ek**************@TK2MSFTNGP04.phx.gbl...
That's what I thought.

I was hoping to do it from one function.

Thanks,

Tom
"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:OC**************@TK2MSFTNGP05.phx.gbl...
Put all the logic that does the printing into its own function. Then call
it from both of the event handlers.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:u%****************@TK2MSFTNGP05.phx.gbl...
I have a function that I want to jump to from 2 different controls
(ImageButton and LinkButton).

The problem is I get the error:

Method 'Public Sub PrintPage_Click(sender As Object, e As
System.Web.UI.ImageClickEventArgs)' does not have the same signature as
delegate 'Delegate Sub EventHandler(sender As Object, e As
System.EventArgs)

Is there a way to call the same function from these 2 buttons?

Thanks,

Tom



May 17 '06 #4

P: n/a
It doesn't really, I was just curious if I could.

And you're right about creating another method.

Thanks,

Tom
"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:ee**************@TK2MSFTNGP05.phx.gbl...
Why? Does it really matter?

You could change the PrintPage_Click method to have just EventArgs as the
second argument, which will be fine as long as you are not using any of
the information in the arguments you have now.

But in reality, it's not even worth doing. Creating another method is
trivial.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:ek**************@TK2MSFTNGP04.phx.gbl...
That's what I thought.

I was hoping to do it from one function.

Thanks,

Tom
"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:OC**************@TK2MSFTNGP05.phx.gbl...
Put all the logic that does the printing into its own function. Then
call it from both of the event handlers.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:u%****************@TK2MSFTNGP05.phx.gbl...
I have a function that I want to jump to from 2 different controls
(ImageButton and LinkButton).

The problem is I get the error:

Method 'Public Sub PrintPage_Click(sender As Object, e As
System.Web.UI.ImageClickEventArgs)' does not have the same signature as
delegate 'Delegate Sub EventHandler(sender As Object, e As
System.EventArgs)

Is there a way to call the same function from these 2 buttons?

Thanks,

Tom



May 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.