Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 897271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:51:37+00:00 2026-05-15T14:51:37+00:00

I have a function for which i am sharing a group of link buttons

  • 0

I have a function for which i am sharing a group of link buttons with.
the function signature is like:

protected void FunctionName(object sender, EventArgs e)
{
 ...
}

Now I have about 4-5 link buttons which i am using to call the same function but just filtering the stuff via command argument like:

<asp:LinkButton ID="lbAll" runat="server" Text="All"
                        CommandArgument="all" OnClick="FunctionName"></asp:LinkButton>
<asp:LinkButton ID="lbTop" runat="server" Text="Top" 
                        CommandArgument="top" OnClick="FunctionName"></asp:LinkButton>
(...)

Now, I have a drop down box which needs to do the same thing essentially (on just two of the selected values), i just need to call this function and pass the “all” or “top” argument to the Function: “FunctionName”

this is in C#

I tried to call that function like

FunctionName(this, New EventArgs());

but I dont know how to pass the Argument?

Any ideas on this?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:51:37+00:00Added an answer on May 15, 2026 at 2:51 pm

    Pass the LinkButton with the correct CommandArgument instead of the this:

    FunctionName(lbAll, EventArgs.Empty)
    

    But you really should use the OnCommand event instead of OnClick. OnCommand has CommandEventArgs as second parameter. So you can get them with e.CommandArgument in the method. And call the method width:

    FunctionName(this, new CommandEventArgs("CommandName", "CommandArgument"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a c function which returns a long double . i'd like to
I have a function which parses one string into two strings. In C# I
I have a function which searches an STL container then returns the iterator when
I have an function which decodes the encoded base64 data in binary data but
I have a function which gets a key from the user and generates a
i have a function which retrieves values from a webservice , then loops through
Imagine I have an function which goes through one million/billion strings and checks smth
This is a Windows Forms application. I have a function which captures some mouse
Say I have a C function which takes a variable number of arguments: How
if i have a function A,which can apply a certain rule on a given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.