ReportingAnalyst
MIS
Hi,
This is a simple Northwind based ASP page which I created to show the top level categories. Now I would like to show the products based on the querystring value.
How can I do that?
Thanks.
This is a simple Northwind based ASP page which I created to show the top level categories. Now I would like to show the products based on the querystring value.
How can I do that?
Thanks.
Code:
<%
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
sSQL = "SELECT CategoryID, CategoryName FROM Categories order by CategoryName"
rs.open sSQL, Conn
'Response.Write sSQL
Dim aCategory
If not rs.EOF Then
'Dump the recordset into the above array
aCategory = rs.getRows()
rs.Close
Set rs = Nothing
Dim iRows
For iRows = 0 to UBound(aCategory, 2)
CatID = aCategory(0, iRows)
%>
<ul id="menu">
<li>
<input type="radio" checked name="empid" id="Catid<%=aCategory(0, iRows)%>" value="<%=aCategory(0, iRows)%>">
<a href="Categories1.asp?ID=<%=aCategory(0, iRows)%>" class="a_style" onclick="s_Hide('<%=aCategory(0, iRows)%>'); return false;"><%=aCategory(1, iRows)%></a>
<ul id="UI_<%=aCategory(0, iRows)%>" style="display: none">
[b]<%
'On load of the page, we see only the top level categories.
'When I point my cursor on the link, then I can see the querystring with
'the category id affixed to the URL.
'Only when we click on a category, the following function needs to be called.
'How to do that?
QS = Request.Querystring("ID")
If QS <> "" Then
'Now pass the querystring to the following function.
Call GetProducts (QS, Counter)
End If
%>[/b]
</ul>
</li>
</ul>
<%
Next 'iRows
End If
%>