-
dynamic link button
hi,
please look at the image attached.
In that image you could see current active user link button. i think this would be dynamically generated. i would like to know how this could be achieve in asp.net? which control should i use?i would like to show the button as vertically with some distance between the users.please let me know if there is any sample code for this to understand.
-
Re: dynamic link button
You would still use a LinkButton but you would just create a procedure to dynamically create them all.
Dim linkB as New LinkButton
LinkB.Text = "Besoup"
'set other properties
Me.Form.Controls.Add(LinkB)
-
Re: dynamic link button
hi, i know how to create dynamic controls.but i have a doubt in the space beweenn the dynmics controls.because if u see the link which i mentioned in the above thread it is vey nice to see.because the space between each link button look and feel is good. like that i have to do.is there any samples please share with me .
-
Re: dynamic link button
You can use DataBinding controls like Repeater. In a Repeater, add a LinkButton, add your custom formatting (adding space, seperators etc.), get data in dataset or datatable, and bind it. No need to dynamically add controls.
Well, this is just another way of skinning a cat (as Mendhak claims). :)
-
Re: dynamic link button
There are a bajillion ways to do this.
You could use a Literal control and in the code behind, dynamically add anchor tags with the correct urls.
You could use a Panel control and dynamically add LinkButton controls.
There are many ways. All of them basically involve getting the correct data form your database and writing it out in the address.
-
Re: dynamic link button
If you want vertical, go for a repeater. Define your Template in the repeater with the right spacing that you need. If you're not clear, then do a search on any of the control names that we have given you. It's a simple matter of defining your own template that will be rendered out.
I think your main concern should be how you're going to get the list of logged on users. Or have you figured that out already?
-
Re: dynamic link button
Thank you guys for the efficient answers.