How can I dynamically link to different records in

Results 1 to 3 of 3

Thread: How can I dynamically link to different records in

  1. #1
    Join Date
    Dec 1969

    Default How can I dynamically link to different records in

    I have built an ASP page that lists out certain fields in my database and writes these fields into a table. This table is, in essence, an Index Page which serves the purpose that someone can click on the product they wish to view all of the specs for. I need to make this field in the table a link. I need it to link to the correct record which contains the specs for that particular product which the user clicked on. So, how do I pass this on-click information to the display.asp page I have built? I have tried to make the link a query string and then call that query string in the display.asp page. I don't think my code is correct however. I'm unable to get this functionality to work. I'm hoping someone can please help me!!!

  2. #2
    Mitch Trope Guest

    Default RE: How can I dynamically link to different record

    The best way I have found to do this is to use a query string. In your index page, the code for the links should look something like this:<BR>while not(rst.eof)<BR>%&#062;<BR>&#060;a href=display.asp?productID=&#060;%=rst.Fields("pro ductCode")%&#062;&#062;View this product!&#060;/a&#062;<BR>&#060;%<BR>&#039;generate rest of info in the table here<BR>Wend<BR><BR>This will generate a link to every product in your recordset based on the product number. In your display page, you need to have a line that takes the information from the line in the browser:<BR><BR>productID = Request.QueryString("productID")<BR><BR>Then, write your query for the product informaiton like this:<BR><BR>query = "SELECT * FROM products where productID=" & productID<BR><BR>Open a recordset based on this query, and you should have all the information you need to create a display page for an individual product.<BR><BR>Hope this helps.

  3. #3
    Join Date
    Dec 1969

    Default RE: Mitch, Thank You Very Much! I'll try thi

    Thank You!

Posting Permissions

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