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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:37:39+00:00 2026-05-25T18:37:39+00:00

According to MSDN I can have an OnClick for a LinkButton –> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linkbutton.onclick(v=VS.90).aspx However,

  • 0

According to MSDN I can have an OnClick for a LinkButton –> http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linkbutton.onclick(v=VS.90).aspx

However, When I try to do following

 foeach(var item in items)
 {
 var link = new LinkButton
           {
               Text = item.Policy.PolNumber,
               OnClick = 
           };
 }

I don’t have access to OnClick 🙁 where I can specify a C# function to be called. I do however have OnClientClick but that is for calling javascript function 🙁 Right?
I also tried

var link = new LinkButton {Text = item.Policy.PolNumber};
link.Click +=new EventHandler(link_Click);

protected void link_Click(object sender, EventArgs e)
{
   //Do my stuff
}

This is never being executed 🙁

I am trying to achieve this with a ASP table. In the foreach loop I am also doing.

var tRow = new TableRow();
var link = new LinkButton {Text = holding.Policy.PolNumber};
link.Click +=new EventHandler(link_Click);
var tCell = new TableCell ();
tCell.Controls.Add(link);
tRow.Cells.Add(tCell);
  • 1 1 Answer
  • 1 View
  • 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-25T18:37:39+00:00Added an answer on May 25, 2026 at 6:37 pm

    You need to add the link button to controls container or some other container on your page. That should be having the property runat=”server”. Looks like your linkbutton is not having the property runat=”server” set. You can check in one of the replies in the following link for a sample dynamic link button creation.

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

Sidebar

Related Questions

According to MSDN ( http://msdn.microsoft.com/en-us/library/system.windows.forms.label.autosize.aspx ), there's a note about Label 's AutoSize property:
According to http://msdn.microsoft.com/en-us/library/ms535934(v=VS.85).aspx and http://msdn.microsoft.com/en-us/library/ms535262(v=VS.85).aspx , I should be able to do the following
According to http://msdn.microsoft.com/en-us/library/aa984351%28VS.71%29.aspx Disabling the first or toplevel menu item in a menu (for
I have a couple of questions about transactions in WF4... According to this http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/aeab2bcd-26c6-49be-8e08-d65ee2688038
According to msdn Enums cannot have a base type of char. Why can enums
SQLCMD uses windows authentication by default. According to the MSDN documentation , you can
According to MSDN , a hash function must have the following properties: If two
So, according to MSDN , System.Threading.Timer calls it's callback delegate on a ThreadPool thread.
HttpResponse.End() seems to throw an exception according to msdn. Right now i have the
When i call CreateDelegate(delegateType) i get a System.ArgumentException , which according to MSDN is

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.