Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. need help wit creating dynamic links

need help wit creating dynamic links

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorialquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neodeaths
    wrote on last edited by
    #1

    hi i am trying to create a website with dynamic links. my idea is to use a datalist and link it wit my ms sql database so depending on how many records i have in my ms sql database it would have the same amount of links created. also i would like the links to be images which names can be found in the same ms sql database. is this possible? would any one please guild me on how to do this as i saw many web site wit this feature and would like to learn them pls

    C L E 3 Replies Last reply
    0
    • N neodeaths

      hi i am trying to create a website with dynamic links. my idea is to use a datalist and link it wit my ms sql database so depending on how many records i have in my ms sql database it would have the same amount of links created. also i would like the links to be images which names can be found in the same ms sql database. is this possible? would any one please guild me on how to do this as i saw many web site wit this feature and would like to learn them pls

      C Offline
      C Offline
      CWIZO
      wrote on last edited by
      #2

      Put a repeater into your page, define how each row looks and then bind your data from db to the repeater.

      -------------------------------------------------------- My portfolio & development blog Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!

      1 Reply Last reply
      0
      • N neodeaths

        hi i am trying to create a website with dynamic links. my idea is to use a datalist and link it wit my ms sql database so depending on how many records i have in my ms sql database it would have the same amount of links created. also i would like the links to be images which names can be found in the same ms sql database. is this possible? would any one please guild me on how to do this as i saw many web site wit this feature and would like to learn them pls

        L Offline
        L Offline
        lavanya_satheesh
        wrote on last edited by
        #3

        a repeater will be a good choice for ur problem. datlist is used if u need to make changes to the data. since u just need some links to another page, it is always better to use repeater. love, lavanya

        1 Reply Last reply
        0
        • N neodeaths

          hi i am trying to create a website with dynamic links. my idea is to use a datalist and link it wit my ms sql database so depending on how many records i have in my ms sql database it would have the same amount of links created. also i would like the links to be images which names can be found in the same ms sql database. is this possible? would any one please guild me on how to do this as i saw many web site wit this feature and would like to learn them pls

          E Offline
          E Offline
          Exelioindia
          wrote on last edited by
          #4

          Hi, Yes repeater is an good option. You can do it as: Code: qrystr = "select link_text,url from url_links" adaplnk = New SqlDataAdapter(qrystr, conn) adaplnk.Fill(drlnk) y = drlnk.Rows.Count Repeater2.DataSource = drlnk Repeater2.DataBind() Design: <%if y> 0 then%>   < asp:repeater id="Repeater2" runat="server" > < ItemTemplate > < a target="_blank" href="<%#DataBinder.Eval(Container.DataItem, "url")%>" class="popurl" > < IMG height="11" src="images foldername/<%#DataBinder.Eval(Container.DataItem, "link_text")%>" width="14" border="0 >< /a >< /ItemTemplate > < /asp:repeater > <%end if%>

          Know is Drop, Unknown is Ocean

          N 1 Reply Last reply
          0
          • E Exelioindia

            Hi, Yes repeater is an good option. You can do it as: Code: qrystr = "select link_text,url from url_links" adaplnk = New SqlDataAdapter(qrystr, conn) adaplnk.Fill(drlnk) y = drlnk.Rows.Count Repeater2.DataSource = drlnk Repeater2.DataBind() Design: <%if y> 0 then%>   < asp:repeater id="Repeater2" runat="server" > < ItemTemplate > < a target="_blank" href="<%#DataBinder.Eval(Container.DataItem, "url")%>" class="popurl" > < IMG height="11" src="images foldername/<%#DataBinder.Eval(Container.DataItem, "link_text")%>" width="14" border="0 >< /a >< /ItemTemplate > < /asp:repeater > <%end if%>

            Know is Drop, Unknown is Ocean

            N Offline
            N Offline
            neodeaths
            wrote on last edited by
            #5

            ok i will try it out thx for the help i will post again if i got any other question regarding the repeater =)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups