This topic is locked

Customizing the Query based on a variable passed in the URL

2/20/2008 3:15:00 PM
ASPRunnerPro General questions
G
gr8britton author

Hi! A friend of mine just turned me onto your product and I am trying it out. I want to be able to pass a variable with the location # in the URL (i.e. - http://www.mysite.com/page.asp?loc=23)). I figure I would process this in the events but I am just not figuring it out. How would I append to the SQL so it adds a WHERE clause like...
WHERE LocationID='23'
(where 23 would be the number coming from the URL)
Thanks!

Sergey Kornilov admin 2/20/2008

Use Request.QueryString("loc") variable.

strSQL = strSQL & " WHERE LocationID='" & Request.QueryString("loc") & "'"

G
gr8britton author 2/20/2008

That was exactly it! Thank you so much for the info and your help. I have a couple of other tweaks I would do to make it live, but this shows me I can do what I need to do. And, support is fast!
Thanks.

G
gr8britton author 2/25/2008

Next Step...
When it displays the results, I would like the link for the record to point to a different URL, based on one of the fields. For instance, the link to view the record currently is http://ictsupport/content/test/Issues_view.asp?editid1=7734, which was generated by ASPRunner. I would like it to point to http://ictsupport/issues/Issue_View.asp?IssueNbr=7734, instead.
How do I make the View link point to an external URL?
Thanks,

Rob

Sergey Kornilov admin 2/26/2008

Rob,
Proceed to the list page in Visual Editor, make View link selected and switch to HTML mode.
Here is how the typical View link looks:

<A class=tablelinks id=viewlink{$row.1recno} href="Issues_view.asp?{$row.1editlink}">View</A>


Modify it the following way:

<A class=tablelinks id=viewlink{$row.1recno}

href="http://ictsupport/issues/Issue_View.asp?IssueNbr={$row.1keyblock}">View</A>
G
gr8britton author 2/26/2008

Thank you for the info. I'll give that a shot today.

G
gr8britton author 2/26/2008

That worked. Thanks!

G
gr8britton author 2/28/2008

This has now led to a new issue. Since my list is generated by the ?loc=## in the URL, the Pagination doesn't work. The pagination, it appears, ads ?goto. How can I:

  1. Turn off pagination and list all records on the list, or
  2. Change the pagination to pass ?loc=##&goto=# (getting ?loc=## from the URL it is currently at) instead of just ?goto=#
    Thanks, again!

Sergey Kornilov admin 2/29/2008

Please contact me directly with your order number.

G
gr8britton author 3/4/2008

Will do...as soon as my buyer gets it purchased! Thanks.

Please contact me directly with your order number.