Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1008561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:47:25+00:00 2026-05-16T08:47:25+00:00

I’ve done this a long time ago, now I can’t find the function. It

  • 0

I’ve done this a long time ago, now I can’t find the function. It shouldn’t be too complicated, but I wonder if there’s any news on this before I go and do it again…

Take this:

www.example.com?query=whatever&page=1

Now imagine I press button to page 2, it will become:

www.example.com?query=whatever&page=2

Always keeping the rest of the querystring intact. Now picture on page 2 I press the button to order by date, it should turn into:

www.example.com?query=whatever&page=1&order=date

Problem is, on the ASP code for ordering, I don’t want to handle every other querystring. So I need a function to handle it for me and be able to do something like the following examples:

<a href="?<%= add_querystring(qs, "order", "date") %>">date</a>
<a href="?<%= set_querystring(qs, "page", page + 1) %>">next page</a>
<a href="?<%= add_querystring(del_querystring(qs, "page"), "allpages") %>">all pages</a>

This is just an initial idea of what I am going to do if I still can’t find a ready solution… Again, just wondering if there’s anything new out there to handle all this in ways I haven’t even imagined yet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:47:26+00:00Added an answer on May 16, 2026 at 8:47 am

    If it’s of anyone’s interest, here’s the quite confusing code I rolled on yesterday:

    'Build a string QueryString from the array Request
    function bdl_qs (req_qs)
        dim result, qa, item
        result = empty
        qa = "?"
        if isnull(req_qs) or isempty(req_qs) then req_qs = Request.QueryString
        for each item in req_qs
            result = result & qa & item
            result = result & "=" & req_qs(item)
            qa = "&"
        next
        bdl_qs = result
    end function
    
    'Build a string QueryString ontop of the supplied one, adding the query and / or value(s) to it
    function add_qs (qs, q, s)
        dim result
        result = qs
        if left(result, 1) = "?" then
            result = result & "&" & q
        else
            result = "?" & q
        end if
        if not isnull(s) and not isempty(s) then 
            result = result & "=" & s
        end if  
        add_qs = result
    end function
    
    'Build a string QueryString ontop of the supplied one, removing the selected query and / or values
    function del_qs (qs, q)
        dim result, item
        result = qs
        if left(qs, 1) = "?" then
            dim rqs, qa
            rqs = result
            result = "?"
            rqs = right(rqs, len(rqs)-1) 'remove the "?"
            rqs = Split(rqs, "&") 'separate the queries
            qa = ""
            for each item in rqs
                dim rq
                rq = Split(item, "=") 'separate the query to analyze the name only
                if rq(0) <> q then 'good for rebuilding
                    result = result & qa & item
                    qa = "&"
                end if
            next
        end if
        del_qs = result
    end function
    
    'Build a string QueryString ontop of the supplied one, setting the query to the value
    function set_qs (qs, q, s)
        set_qs = add_qs(del_qs(qs, q), q, s)
    end function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.