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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:58:24+00:00 2026-05-12T06:58:24+00:00

I have created a user control that will contain a table of LinkButtons (and

  • 0

I have created a user control that will contain a table of LinkButtons (and other information). I create the table rows in another custom object and return a TableRowCollection with the link buttons in certain cells of these table rows.

In the code behind for the user control I created an event handler for the button click of these LinkButtons. I pass the user control into the method call to create the table rows (using “this”) and then attempt to add the event handler to the “Click” of the LinkButton. For some reason, the event handler doesn’t fire on a post back caused by this button. Any ideas as to what I could do to make this event fire?

Here is the code where I create the button and add the event handler:

LinkButton button = new LinkButton();
button.Text = movie.Title;
button.Click += new EventHandler(control.Link_Click);
button.CommandArgument = result.LocalID.ToString();
cell1.Controls.Add(button);

Where “control” is the user control passed in as a parameter and “Link_Click” is the event handler.

Thanks in Advance!

  • 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-12T06:58:24+00:00Added an answer on May 12, 2026 at 6:58 am

    First off, if the event handler is already inside the user control, there is no need to pass a reference to it into its own method. You can simply access any property or method inside the event handler.

    Events rely on the control ID’s to wire-up to the correct control. If you are not creating your linkbuttons exactly the same way every time on the postback, and ensuring that they have the same ID as they did before, then your event handler won’t fire, because the ASP.Net pipeline won’t be able to find what it thinks it the correct button in the control tree.

    Additionally, if you are re-binding your user control to its datasource on every postback, this can cause events for some controls to get lost, for the same reason detailed above.

    Check to make sure that you’re recreating your controls properly every time, and that you’re not re-binding your user control every time.

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

Sidebar

Related Questions

I have created a user control (CheckedDirTree) that exposes a CheckedFolder property which in
I have a user control that I've created, however when I go to add
I have created a user control that contains a button. I am using this
I am trying to create a user control within a WPF application that will
I have a user control, GridMasterControl which contains (amongst other things) another control called
I have a user control I have created that contains a details-view that I
I have created an Address user control which is as follow: <%@ Control Language=C#
I have created a COM enabled .NET User Control and am wondering what is
We have created a User Control for ASP.Net. At any one time, a user's
I needed to create a custom select list for the user registration page that

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.