Forums
This topic is locked
Response.Redirect with variables set to Recordset
Posted 08 Sep 2002 08:30:34
1
has voted
08 Sep 2002 08:30:34 Sherwin Nelson posted:
Hi everyone,I'm trying to do a response.redirect based on if a recordset have only one value. OK, I got the code doing the redirect but, try as I might I can't seem to attach the nessecary variables that is requested on the page I redirect to.
This is the piece that is giving me problems(Note the values are comming from the same rsCatMain)
--------------------------------------------
<%
if (rsCatMain.RecordCount == 1)
{
Response.Redirect ("processtype.asp?var1=rsCatMain("var1"
}
%>
Any help is appriciated.
--------------------------------------------
Here is the code as it works now(javascript)
--------------------------------------------
<%
var rsCatMain = Server.CreateObject("ADODB.Recordset"
rsCatMain.ActiveConnection = MM_connMenStore_STRING;
rsCatMain.Source = "SELECT CatergoryID, CatergoryName, ProductID, ProductDetailID, DepartmentID, ProductName, UnitPrice, (UnitPrice*DiscountRate) AS YouSave, (UnitPrice-YouSave) AS YouPay, BrandName, ProcessType, SmallPicture, ProductSetName, ProductSetName2, ProductSetName3, dateAdded FROM ProductQuery WHERE CatergoryID="+ rsCatMain__strCatID.replace(/'/g, "''"
rsCatMain.CursorType = 3;
rsCatMain.CursorLocation = 2;
rsCatMain.LockType = 1;
rsCatMain.Open();
var rsCatMain_numRows = 0;
%>
<%
if (rsCatMain.RecordCount == 1)
{
Response.Redirect ("processtype.asp?" );
}
%>
--------------------------------------------
Edited by - jewels on 08 Sep 2002 08:32:23
Replies
Replied 09 Sep 2002 05:29:44
09 Sep 2002 05:29:44 aegis kleais replied:
Try :
<%
if (rsCatMain.RecordCount == 1)
{
Response.Redirect Server.URLENcode(("processtype.asp?var1=" + rsCatMain("var1"
+ "&var2=" + rsCatMain("var2"
+ "&var3=" + rsCatMain("var3"
+ "so on and so forth"
);
}
%>
I'm assuming you're using Javascript.
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
<%
if (rsCatMain.RecordCount == 1)
{
Response.Redirect Server.URLENcode(("processtype.asp?var1=" + rsCatMain("var1"
}
%>
I'm assuming you're using Javascript.
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])