troubleshooting Question

Button onclick Event

Avatar of grogo21
grogo21 asked on
ASP.NETVisual Basic.NET
3 Comments1 Solution5777 ViewsLast Modified:
Hello, I have sever buttons on my page.  Is it possible to point all of them to the same method but have them pass different values to the method like:

    Protected Sub LinkButtonClick(ByVal CatId As Integer)
           'Code
    End Sub

<html>
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButtonClick(1)"><%#Eval("SubCatName")%></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButtonClick(2)"><%#Eval("SubCatName")%></asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkButtonClick(3)"><%#Eval("SubCatName")%></asp:LinkButton>
</html>

I am getting error " 'AddressOf' operand must be the name of a method (without parentheses)." when I attempt to do what I have above.  

Thanks Very Much!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros