Send two parameters in a hred using classic Asp

Asked

Viewed 245 times

0

I would like the code below to send two parameters to the page request name DetalheComercio.asp. The parameters would be: Neighborhood and Category (the link below only sends a category parameter). This page pulls data from a name table: Tabbairro with the following fields: Idbairro, Bairro, Estado, Detalhe, Quantfoto, Video, Obs...

This page pulls data from a name access table TabCategoria, with the following fields: Idcategory, Category, Obs..., and creates a list with a link that shoots to the page DetalheComercio.asp. That is, my goal is to make, when clicked, the link opens the page Detalhecomercio.asp and show all establishments with the category clicked in this neighborhood. The page can be seen at this link.

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

What’s happening is that the link opens all the 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 Detail page will show 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 OF 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
%>
  • The page is not yet finished FORGOT TO TELL TO CLICK ON THE LINK (automotive) to access the page Detailsmercio.asp. Thanks

  • 1

    Face I’ll be honest, the text is very repetitive, I could hardly edit it. A tip, try to be more objective in the problem and in doubt, it makes it easy enough to understand the question and get answers.

  • 1

    I answered for what I could understand, but as @diegofm said, it’s hard.

1 answer

1

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.