Redirect if Recordset is Empty WITH original URL Parameter

Posted on 2009-04-27
Last Modified: 2012-05-06
Hi I have a page setup where menus.asp links to subcategory.asp then to menu_details.asp.

But in the event there is no sub category for a menu category I want to redirect from menus to menu_details.asp with the original url parameter.

How could I acheive this?
Here is my code on the menus.asp page that links to the subcategory.asp page:


Here is my redirect code which will redirect if there is no subcategory for a particular category:


If rsSubCat.EOF And rsSubCat.BOF Then


End If


Open in new window

Question by:vonfranzken
    LVL 44

    Accepted Solution

    Hello vonfranzken,

    Response.Redirect("menus_details.asp?" & Request.QueryString)

    Should do it.


    LVL 22

    Assisted Solution


    try this

    If rsSubCat.EOF And rsSubCat.BOF Then
    Response.Redirect("menus_details.asp?" & Request.QueryString())
    End If

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now