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
  • 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-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 this http://msdn.microsoft.com/en-us/library/cc849094(v=vs.85).aspx#OptInHighDPI you can make your web browser control use IE8-style zooming,
According to [MSDN: Array usage guidelines]( http://msdn.microsoft.com/en-us/library/k2604h5s(VS.71).aspx) : Array Valued Properties You should use
According to http://msdn.microsoft.com/en-us/library/aa916070.aspx (DnsQuery_W), DNS query libraries are available on Windows Mobile / CE
First off, according to http://msdn.microsoft.com/en-us/library/x0b5b5bc.aspx , the List.Find method is only listed as throwing
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
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
I am using a technique similar to http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/df77a277-91d4-41f1-a42a-0fa02a443ff4/ I have a DaataGridTemplateColumn built, in
According to msdn Enums cannot have a base type of char. Why can enums
According this MSDN article HttpApplication .EndRequest can be used to close or dispose of
According to MSDN you have to create a non-blocking socket like this: unsigned nonblocking

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.