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. how to create dynamic link

how to create dynamic link

Scheduled Pinned Locked Moved ASP.NET
csharpcomhelptutorialquestion
6 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.
  • P Offline
    P Offline
    Pradip Kishore
    wrote on last edited by
    #1

    hi all i want to know how to create dynamic links/urls like.. http://www.abc.com/demo/server01/Tab.asp?Tab=2&PROJECT\_ID=75" i want to know how to create the urls from.. "tab.asp?tab=2&project_id=75 " how to create these id values automatically and how to access them when i want to hyperlink them to another page... for ex: i have table like: name profession skills -------------------------------------- pradip software .net john telecom cdma ... .... ..... i want to make my each entry of name,profession,skills to be hyperlinked so that when ever i will click on any item...it will generate a link like the above mentioned and accordingly navigate to the detailed page... its urgent..please help me.. thanks in advance..

    pradip kishore

    P G 2 Replies Last reply
    0
    • P Pradip Kishore

      hi all i want to know how to create dynamic links/urls like.. http://www.abc.com/demo/server01/Tab.asp?Tab=2&PROJECT\_ID=75" i want to know how to create the urls from.. "tab.asp?tab=2&project_id=75 " how to create these id values automatically and how to access them when i want to hyperlink them to another page... for ex: i have table like: name profession skills -------------------------------------- pradip software .net john telecom cdma ... .... ..... i want to make my each entry of name,profession,skills to be hyperlinked so that when ever i will click on any item...it will generate a link like the above mentioned and accordingly navigate to the detailed page... its urgent..please help me.. thanks in advance..

      pradip kishore

      P Offline
      P Offline
      PSK_
      wrote on last edited by
      #2

      Follow following steps. 1-Create a Datagrid and place a template column where you want to palce the hyperlink to appear. Eg:

      <asp:TemplateColumn HeaderText="Details">
      <ItemTemplate>
      <a href=http://url+?id='<%# DataBinder.Eval(Container.DataItem, "project_id")
      %>'>Details</a>
      </ItemTemplate>
      </asp:TemplateColumn>

      2: Load the values from database to a data table of data reader and bind it to Datagrid. 3: In the recieving page get the id from query string and fetch details from the database on basis of that id. Note: you need to create the correct hyperlink in the ItemTemplate column, here i have created just a dummy link. Regards Prakash

      1 Reply Last reply
      0
      • P Pradip Kishore

        hi all i want to know how to create dynamic links/urls like.. http://www.abc.com/demo/server01/Tab.asp?Tab=2&PROJECT\_ID=75" i want to know how to create the urls from.. "tab.asp?tab=2&project_id=75 " how to create these id values automatically and how to access them when i want to hyperlink them to another page... for ex: i have table like: name profession skills -------------------------------------- pradip software .net john telecom cdma ... .... ..... i want to make my each entry of name,profession,skills to be hyperlinked so that when ever i will click on any item...it will generate a link like the above mentioned and accordingly navigate to the detailed page... its urgent..please help me.. thanks in advance..

        pradip kishore

        G Offline
        G Offline
        gauthee
        wrote on last edited by
        #3

        when you are providing the target url for the names generate the dynamic url. lets say you got all the data frm db and have it in a dataset. then it wouldbe targeturl=www.abc.com/....?name"+ds.tables[0]["columnname"]......

        Gautham

        C 1 Reply Last reply
        0
        • G gauthee

          when you are providing the target url for the names generate the dynamic url. lets say you got all the data frm db and have it in a dataset. then it wouldbe targeturl=www.abc.com/....?name"+ds.tables[0]["columnname"]......

          Gautham

          C Offline
          C Offline
          coolestCoder
          wrote on last edited by
          #4

          What would happen if some special characters are stored in the database ? ( for example "&" which is used in query strings )


          "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


          coolestCoder

          G 1 Reply Last reply
          0
          • C coolestCoder

            What would happen if some special characters are stored in the database ? ( for example "&" which is used in query strings )


            "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


            coolestCoder

            G Offline
            G Offline
            gauthee
            wrote on last edited by
            #5

            Good question, never came across that! Make sure that your database doesnt have any specila characters, kidding! May be we have o filter the value again at the front end??? You know the answer?

            Gautham

            C 1 Reply Last reply
            0
            • G gauthee

              Good question, never came across that! Make sure that your database doesnt have any specila characters, kidding! May be we have o filter the value again at the front end??? You know the answer?

              Gautham

              C Offline
              C Offline
              coolestCoder
              wrote on last edited by
              #6

              when inserting data into database always HtmlEncode it first. When displaying the data on forms HtmlDecode it.


              "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


              coolestCoder

              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