I need to add linked buttons based on the code-behind data -set which is populated. How do I do that? Can I make a placeholder? I can not add anyone, one or many different linked buttons call me a linked button as a method in the code-back.
Since you are dynamically generated links button, so you will have a need to make panel or placeholder so you can add your link to the panel so that you can know that they will go on their client-side:
< Pre> & lt; Asp: Place holder id = "link holder" run = "server" & gt; & Lt; / Asp: place holder & gt; back your code
Private Sub Page_Load (ByVal in as the System.Object, ByVal e System.EventArgs) I to handle MyBase.Load 2 = 0 is // it is you need to iterate add many links you based on your datasets sent to ctrl dim as new LinkButton // and since it Based on the database that you need to give them unique IDs if you want to know which data adder So it was like clicking on ctrl.ID = "Create" Ctrl "to your database ctrl.Text = DB.id + field" Column "+ DB.id // ID seems to be a" . The CommandArgument = "myargument" ctrl.CommandName = "mycommandname" AddHandler ctrl.Click, AddressOf link_button_click Linkholder.Controls.Add (Ctrl) Next End Sub Sub link_button_click (ByVal as the object, as ByVal e System.EventArgs) as LinkButton lb dim = CType (sender, Linkbtn) displayObjects (lb.CommandArgument) end sub
but how do I dynamically not gone add link button on the client side but false , So you can also click on the properties in control that you want them to be Not want to take which place and what happens behind your code. The postback is that you want to make the link appear to be true to appear attribute. When this happens:
Back
in the code public Page_Load (object sender, EventArgs e) {if (// dataset to do whatever it links to show Seems to be) {Link1.visible = true; }} Public Link 1 Method (Object Sender, EventAgds E) {// Link 1 Method onClick}
Comments
Post a Comment