LinkButton / Call Function

S

Shapper

Hello,

I have an Asp:LinkButton:
<asp:linkbutton id="myLinkButton" runat="server"
oncommand="Upload_New_Files"/></asp:linkbutton>

I have the following function:
Sub Upload_New_Files(ByVal sender As Object, ByVal e As
CommandEventArgs) Handles myLinkButton.Click
...
End Sub

I get this error:
Method 'Public Sub Upload_New_Files(sender As Object, e As
System.EventArgs)' does not have the same signature as delegate
'Delegate Sub CommandEventHandler(sender As Object, e As
System.Web.UI.WebControls.CommandEventArgs)'.

Can someone tell me what am I doing wrong?

I only want to call Upload_New_Files when the linkbutton is clicked.

Thanks,
Miguel
 
S

S. Justin Gengo

Miguel,

It's the parameter objects the subroutine is looking to have sent to it.

The parameters you are passing in:
sender AS Object, e As CommandEventArgs

The error says that the button handler for a link button instead needs
parameters defined as:
sender As Object, e As System.EventArgs

Change your "e As CommandEventArgs" to "e.System.EventArgs" and it will
work.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top