Send two parameters in a hred using classic asp

0

I would like the code below to send two parameters to the request page of name DetalheComercio.asp . The parameters would be: Neighborhood and Category (the link below sends only one category parameter). This page pulls data from a Name Table: TabBall with the following fields: IdBall, Neighborhood, State, Detail, QuantFoto, Video, obs ...

This page pulls data from an access table named TabCategoria , with the following fields: CategoryID, Category, Obs ..., and creates a list with a link that triggers the DetalheComercio.asp page. That is, my goal is to have the link open on the Detalhecomercio.asp Page and click on the neighborhood to show all the establishments with the category clicked on. The page can be viewed in this link .

As seen on the page, I wanted you to click on the Party category to open the page DetalheComercio.asp with all the stores in the AUTOMOTIVE category (for example) of the neighborhood and thus also with the links of each category.

What is happening is that the link opens all records without caring about the neighborhood.

Note: I'm using the top page inside another page in the form of INCLUDE, so the links that you see on the page DetailBairro.asp shows the window with this include.

PAGE SENDING THE LINK

<!--#Include file="dbConexao.inc"-->

<%
'DIM conexaoDataBase
'DIM sqlLanc, rsDados
'Call abreConexao

sqlLanc= " SELECT * "
sqlLanc= sqlLanc & "FROM TabCategoria "
set rsDados = conexaoDataBase.Execute (sqlLanc)

%>


 <% do While not rsDados.eof %>
 <style type="text/css">
 a:link {
    color: #006;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #666;
}
a:hover {
    text-decoration: none;
}
a:active {
    text-decoration: none;
}
 </style>

<a href="DetalheComercio.asp?categoria=<% =rsDados("Categoria") %>"><% =Rsdados("categoria")%></a>&nbsp;&nbsp;

<%rsDados.MoveNext
loop
%>
                      <%
rsDados.close
call fechaConexao
Set rsDados = Nothing
%>

SQL FROM THE PAGE THAT RECEIVES THE LINK

<%
DIM conexaoDataBase
DIM SqlLanc, rsDados, TotalBairro
Call abreConexao

sqlLanc= "SELECT TabLoja.categoria, TabLoja.Idloja, TabLoja.Empresa, TabLoja.rua, TabLoja.numero, TabLoja.Detalhe, TabLoja.telefone, TabBairro.IdBairro, TabBairro.bairro, TabBairro.cidade, TabBairro.estado,  TabBairro.quantfoto " 
sqlLanc = sqlLanc & "FROM TabBairro "
sqlLanc = sqlLanc & "INNER JOIN TabLoja "
sqlLanc = sqlLanc & "ON TabLoja.IdBairro = TabBairro.IdBairro "
sqlLanc = sqlLanc & "WHERE TabBairro.Bairro = '" +request.QueryString("Bairro") + "'"
'sqlLanc = sqlLanc & "WHERE TabCategoria.Categoria = '" +request.QueryString("Categoria") + "'"
SqlLanc =SqlLanc + "ORDER BY Tabbairro.bairro "
set rsDados = conexaoDataBase.Execute (SqlLanc)

TotalBairro = rsDados.recordcount
%>
    
asked by anonymous 27.07.2016 / 14:00

1 answer

1

In your link, you are accessing recordset in two different ways: rsDados and Rsdados , and your link is missing the & querystring concatenation, change it to:

<a href="DetalheComercio.asp?categoria=<%=Server.URLEncode(rsDados("categoria"))%>&bairro=<%=Server.URLEncode(rsDados("bairro"))%>"><%=rsDados("categoria")%></a>
    
27.07.2016 / 14:14