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

  • Home
  • SEARCH
  • 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 115309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:59:56+00:00 2026-05-11T02:59:56+00:00

I need to add linked buttons in the code-behind based on a DataSet that

  • 0

I need to add linked buttons in the code-behind based on a DataSet that is populated. How do I do that? Do I create a placeholder? I could be adding none, one, or many different linked buttons. I lalso need to have each linked button call a method in the code-behind. How would I wire that up when I add the button?

Thank you for any help.

  • 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. 2026-05-11T02:59:56+00:00Added an answer on May 11, 2026 at 2:59 am

    Since you are dynamically created the link buttons you should create a panel or placeholder on your client side so you can append your links to the panel so you would know where they will appear like:

        <asp:PlaceHolder ID='Linkholder' Runat='server'></asp:PlaceHolder>  

    and in your code behind

       Private Sub Page_Load(ByVal sender As System.Object, ByVal e As    System.EventArgs) Handles MyBase.Load       For i = 0 To 2 //this is for you iterate how many links you need to add base on your dataset you referred to        Dim ctrl As New LinkButton   //and since it is based on the Database you need to give them unique ids if you want to know which one was clicked based on the data info like so        ctrl.ID = ''+DB.id  //id is suppose to be a 'column'field from         your database        ctrl.Text = DB.id+'create'        ctrl.CommandArgument = 'myargument'        ctrl.CommandName = 'mycommandname'        AddHandler ctrl.Click, AddressOf link_button_click        Linkholder.Controls.Add(ctrl)      Next    End Sub     Sub link_button_click(ByVal sender As Object, ByVal e As System.EventArgs)    Dim lb As Linkbutton = CType(sender, LinkButton)     displayObjects(lb.CommandArgument)­ ­     End Sub 

    But if not dynamically How about you add the link buttons on the client side but set visible to false so you can also have the attributes onclick in the controls to what method you want them to go to and in your code behind based on what happens in your postback that you want to make the links appear.just set the attribute to true when that happens like so:

     <asp:linkbutton id='link1' runat='server' onclick='link1method' visible='false'/> 

    in code behind

     public Page_Load(object sender, EventArgs e) {      if(//is dataset whatever it is suppose to be for link to show)    {        link1.visible=true;    }  }  public link1method(object sender, EventArgs e) {     //for link1 method onclick  } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 92k
  • Answers 92k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer IIRC, the maximum plane area for a Graphics object is… May 11, 2026 at 6:32 pm
  • Editorial Team
    Editorial Team added an answer Create user with mysql_query(); Assuming the primary key of the… May 11, 2026 at 6:32 pm
  • Editorial Team
    Editorial Team added an answer I typically take a bottom-up approach to testing, but I… May 11, 2026 at 6:32 pm

Related Questions

How do I bind a ProgressBar to a property of a class updated in
I'm using an HTML sanitizing whitelist code found here: http://refactormycode.com/codes/333-sanitize-html I needed to add
I have been asked to setup a course leaflet system for a college. For
In LINQ to SQL, is InsertOnSubmit() required when adding via a Foreign Key? I.e.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.