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 9170529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:02:10+00:00 2026-06-17T16:02:10+00:00

The problem I’m having, is that I need to pass in multiple arguments through

  • 0

The problem I’m having, is that I need to pass in multiple arguments through a button click. I have a repeater object that prints out values from a sqlquery, and the button has arguments that are from that same query

Here is My Repeater:

 <asp:Repeater ID="Edit_Repeater" runat="server" DataSourceID="Edit_Repeater_Source">
                <HeaderTemplate>
                    <table class="u_Repeater">
                        <tr>
                            <th>
                                Group Name:
                            </th>
                            <th>
                                Permission Level:
                            </th>
                            <th>
                                Remove:
                            </th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <%#DataBinder.Eval(Container.DataItem, "Group_Name")%>
                        </td>
                        <td>
                            <%#DataBinder.Eval(Container.DataItem, "Name")%>
                        </td>
                        <td>
                            <asp:Button ID="Submit_Remove" runat="server" Text="Remove Permission" OnClick="Remove_Permission" CommandArgument='<%# Eval("GID") + ";" + Eval("PID") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>

And here is my code behind:

protected void Remove_Permission(object sender, CommandEventArgs e)
    {
        string[] arg = new string[2];            
        string[] commandArgs = e.CommandArgument.ToString().Split(';');
        float GID = float.Parse(arg[0]);
        float PID = float.Parse(arg[1]);
        string UID = User_ID.SelectedValue;

        using (SqlConnection connection = new SqlConnection(WebConfigurationManager.ConnectionStrings["app_migrationConnectionString"].ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("DELETE FROM Membership WHERE GID = @GID AND PID = @PID AND UID = @UID", connection);
            cmd.Parameters.Add("@GID", SqlDbType.BigInt, -1);
            cmd.Parameters["@GID"].Value = GID;
            cmd.Parameters.Add("@PID", SqlDbType.BigInt, -1);
            cmd.Parameters["@PID"].Value = PID;
            cmd.Parameters.Add("@UID", SqlDbType.NVarChar, -1);
            cmd.Parameters["@UID"].Value = UID;

            try
            {
                connection.Open();
                cmd.ExecuteNonQuery();
                connection.Close();
            }

            catch (Exception ex)
            {

                throw ex;
            }
        }
    }

I’m getting no build errors, but when I run the page I get a Compilation Error saying:

No overload for ‘Remove_Permission’ matches delegate ‘System.EventHandler’

I’m almost positive the code is right, so what is the problem?

  • 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-06-17T16:02:11+00:00Added an answer on June 17, 2026 at 4:02 pm

    Change your CommandEventArgs to EventArgs – then cast your sender to Button and get the command argument from there.

    protected void Remove_Permission(object sender, EventArgs e)
    {
        var button = sender as Button;
        if (button !=null)
        {
            var commandArg = button.CommandArgument;
            //etc....
        }
    }
    

    Or use the Command Event instead of the Click event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have a table that prints out vertical but I would like it
Problem: I have two arrays that can possibly be different lengths. I need to
Problem: I have a non-copyable object with two constructors. I need to create an
Problem : I have multiple projects checked out in my depot. I also have
Problem I have a piece of java code (JDK 1.6.0._22 if relevant) that implements
Problem: I have a monitor program in Python that uses subprocess' Popen to start
Problem: I have code that looks for a file and open it. By default
Problem I have now is that the stored procedure called by the jdbcTemplate returns
Problem: I have two array where one produce a category and the second produce
Problem Using Director 11.5 and Windows 7, with MouseWheel Xtra (wheelmouse.zip), I have the

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.