Results 1 to 7 of 7

Thread: dynamic link button

  1. #1

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    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.
    Last edited by karthikeyan; Mar 4th, 2009 at 10:06 AM.
    Loving dotnet

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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)

  3. #3

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    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 .
    Loving dotnet

  4. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    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).
    Show Appreciation. Rate Posts.

  5. #5
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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?

  7. #7

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    Re: dynamic link button

    Thank you guys for the efficient answers.
    Loving dotnet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width