locked
Passing a recordset variable as a querystring RRS feed

  • Question

  • User-1212847090 posted

    Hi All, 


    Still kinda new to asp.net so please bear with me.


    I want to pass a recordset value as part of a querystring in an anchor link, with asp classic. I would just write <a href="website.com/pagename.asp?variable=<%=fieldname%>">Press This</a>

    I want to achieve exactly the same with asp.net, how do I go about doing it? 

    I've tried 

    <a href="bill.aspx?no=<%# Bind ("ship_order_id")%> but I get a parser error

    Thanks in Advance

    Ben

    Thursday, October 22, 2015 11:03 PM

Answers

  • User325035487 posted

    <a href="bill.aspx?no=@ship_order_id">Click Here</a>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 23, 2015 3:03 AM
  • User-1716253493 posted
    href='<%# Eval("fieldname", "website.com/pagename.asp?variable={0}") %>'

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 23, 2015 3:16 AM

All replies

  • User325035487 posted

    <a href="bill.aspx?no=@ship_order_id">Click Here</a>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 23, 2015 3:03 AM
  • User-1212847090 posted

    That easy, wow!

    Thank You jkjhse Smile

    Friday, October 23, 2015 3:15 AM
  • User-1716253493 posted
    href='<%# Eval("fieldname", "website.com/pagename.asp?variable={0}") %>'

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 23, 2015 3:16 AM
  • User-1212847090 posted

    Spoke to soon, there are multiple records in the recordset, using it this way means it displays the entire recordset whereas I want it to display as a link in each recordset for each record.


    1  | field1/record1 | field 2/record1 | URL link to another page based on a value from field1 (record 1)

    2  |field1/record2  | field 2/record2 | URL link to another page based on a value from field1 (record 2) 

    etc etc 

    Friday, October 23, 2015 3:20 AM
  • User-1212847090 posted

    AWESOME!!! 

    Thank You Kindly!!!

    Friday, October 23, 2015 3:27 AM