Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 377
  • Last Modified:

Redirect if Recordset is Empty WITH original URL Parameter

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:
menus_subcategory.asp?sid=<%=(Recordset1.Fields.Item("id").Value)%>
 
Here is my redirect code which will redirect if there is no subcategory for a particular category:
<%
If rsSubCat.EOF And rsSubCat.BOF Then
Response.Redirect("menus_details.asp")
End If
%>

Open in new window

0
vonfranzken
Asked:
vonfranzken
2 Solutions
 
TimCotteeCommented:
Hello vonfranzken,

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

Should do it.

Regards,

TimCottee
0
 
neeraj523Commented:
hello

try this

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now