Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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:</p> <pre><code> &lt;asp:PlaceHolder ID="Linkholder" Runat="server"&gt;&lt;/asp:PlaceHolder&gt; </code></pre> <p>and in your code behind</p> <pre><code> 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 </code></pre> <p>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:</p> <pre><code> &lt;asp:linkbutton id="link1" runat="server" onclick="link1method" visible="false"/&gt; </code></pre> <p>in code behind</p> <pre><code> 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 } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload