Hi, Trying to solve a problem with no knowledge of asp.
I have a dropdown list populated from my database with card decription. The output is names like, abstract,illustration etc.
I am sending the results to another page like so - .. html
-
directory.asp?PostCardID=XX
-
..
Now the request.querystring I presume should be something like this. - ..asp
-
<%=request.QueryString("PostcardID")%>
-
..
But all I get is xx as output.
When someone selects from the dropdown I am trying to populate the page with all those from the database who have the same title and so am trying to get the ids.
Is there something more to this, I am sure there is.
Thanks in advance for any help.
Basically I was told I had to get the get the PostCardID into the action querystring
Richard
32 3563
Hi, Trying to solve a problem with no knowledge of asp.
I have a dropdown list populated from my database with card decription. The output is names like, abstract,illustration etc.
I am sending the results to another page like so - .. html
-
directory.asp?PostCardID=XX
-
..
Now the request.querystring I presume should be something like this. - ..asp
-
<%=request.QueryString("PostcardID")%>
-
..
But all I get is xx as output.
When someone selects from the dropdown I am trying to populate the page with all those from the database who have the same title and so am trying to get the ids.
Is there something more to this, I am sure there is.
Thanks in advance for any help.
Basically I was told I had to get the get the PostCardID into the action querystring
Richard
try the redirect method.
<%
response.redirect "yourtarget.asp?variable=" & StrValueOfYourVariable
%>
or something like that
Hi,
If you are getting any problem accessing querystring , you can even use Hidden varaibles.
e.g.
<Input type ="hidden" name ="PostCardID" value ="value">
and access this value in target.asp as Request.Form("PostCard")
Thanks for the reply guys,
Neither idea could I get to work.
Will bash on.
Thanks
Thanks for the reply guys,
Neither idea could I get to work.
Will bash on.
Thanks
Wait, are you saying that you are getting the postcardID out of the querystring, but you actually want more data from the database? If that is the case, then on the second page you need to open the db again and look up that info. - objRS.open "SELECT * FROM cardTable WHERE postcardID = " & request("postcardID"), objConn
The only information you passed from one page to the other is the postcardID.
Jared
Thanks for the reply guys,
Neither idea could I get to work.
Will bash on.
Thanks
From what I can tell, your problem is related to getting the value to the querystring itself.
Here is the way I normally do it if I only have 1 dropdown, usually for navigation.
[HTML] <select name="navigate" onChange="window.location='directory.asp?PostCardI D=' + this.options[this.selectedIndex].value">[/HTML]
You could also do this through a javascript function. Or you could put the dropdown in a form and when they push the submit button, it would submit the value.
[HTML]<form method="get" action="directory.asp">
<select name="PostCardID">
<input type="submit" />
</form>[/HTML]
Then on the directory.asp you would do like Jared recommended.
Hey Guys, Thanks, I really think I am getting somewhere with your help.
Adding your suggestion to the form I now get the name selected from the dropdown list showing on the next page, ie select abstract art, and abstract art shows up on the target page. Great! - ..asp
-
-
<form method="Post">
-
<select name="navigate" onChange="window.location='manner.asp?PostCardID=' + this.options[this.selectedIndex].value">
-
-
<%
-
Set oRs=Server.CreateObject("adodb.recordset")
-
strSQL = "SELECT DISTINCT CardDescription FROM tblGreetingPostCards ORDER BY CardDescription"
-
oRs.Open strSQL, conn
-
-
Do while not oRs.EOF
-
if Request.Form("GreetingPostCards") = oRs("CardDescription") then 'if this is the selected one then display as selected
-
Response.Write "<OPTION VALUE = '" & oRS ("CardDescription") & "' SELECTED>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
else
-
Response.Write "<OPTION VALUE = '" & oRs ("CardDescription") & "'>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
end if
-
loop
-
%>
-
</SELECT>
-
</form>
-
..asp
And you are spot on, wasnt really explaining well, but I think i probably do need more info from the database. Not sure what is going on exactly, but where exactly would I add the below code.
Basically I need to populate the page with all those in the database with the headings selected. So I imagine I need to get the ids. - ..asp
-
-
objRS.open "SELECT * FROM GreetingPostCards WHERE postcardID = " & request("postcardID"), objConn
-
-
..asp
Tha actual page has all this asp at the top. Do I add it there? and do I have to wrap it in anything? or do I add it to the body of the page. - ..asp
-
-
-
-
-
-
<!--#Include File="art/dbconnect.asp"-->
-
<%
-
-
-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
' Product: Greeting Card Pro Version 2.1
-
' Author: AdComplete.com, LLC
-
' Date: January 21, 2002
-
' (c) Copyright 2000-2002 by AdComplete.com, LLC. All rights reserved.
-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-
-
lngCategoryID=CLng(Request("CategoryID"))
-
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
SQLQuery="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author,ThumbnailURL,AdvancedCard,ThumbnailHTML,Rnd([PostCardID]) From tblGreetingPostCards Where CategoryID=" & Clng(lngCategoryID) & " Order By Rnd([PostCardID])"
-
rsCard.Open SQLQuery, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
-
If rsCard.EOF=True Then
-
Response.Write "<p>No cards found in database for this category."
-
Response.End
-
End If
-
End If
-
-
'search feature
-
If Request("SearchWord") <> "" Then
-
strWd=Replace(Request("SearchWord"),"'","''")
-
strSQL="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author, "
-
strSQL=strSQL & " ThumbnailURL,AdvancedCard,ThumbnailHTML From tblGreetingPostCards Where Keywords Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultHeadline Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " CardDescription Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " Author Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultMessage Like '%" & strWD & "%' "
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
rsCard.Open strSQL, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
End If
-
-
strAddition="bgcolor=" & Chr(34) & Application("gcp_SearchPageBackgroundColor") & Chr(34)
-
strCategoryBarFontColor=Application("gcp_SearchPageFontBarColor")
-
strCategoryBarColor=Application("gcp_SearchPageBarColor")
-
-
'Retrieve Category Name
-
If lngCategoryID <> "" and lngCategoryID <> 0 Then
-
Set rsCat=connPostCardSoft.Execute("Select * From tblGreetingCategories Where CategoryID=" & Clng(lngCategoryID))
-
strCat="" & rsCat("CategoryName")
-
-
If rsCat("CategoryBackgroundImage")<> "" Then
-
strAddition="background=" & Chr(34) & rsCat("CategoryBackgroundImage") & Chr(34)
-
End If
-
If rsCat("CategoryBackgroundColor")<>"" Then
-
strAddition="bgcolor=" & Chr(34) & rsCat("CategoryBackgroundColor") & Chr(34)
-
End If
-
strCategoryBarFontColor=rsCat("CategoryBarFontColor")
-
strCategoryBarColor=rsCat("CategoryBarColor")
-
FontName=rsCat("FontName")
-
FontColor=rsCat("FontColor")
-
Else
-
strCat="Search results for:" & strWD
-
FontName=Application("gcp_FontName")
-
FontColor=Application("gcp_FontColor")
-
End If
-
-
-
Select Case Request("Action")
-
case " << "
-
intpage = 1
-
case " < "
-
intpage = Request("intpage")-1
-
if intpage < 1 then intpage = 1
-
case " > "
-
intpage = Request("intpage")+1
-
if intpage > intPageCount then intpage = IntPageCount
-
Case " >> "
-
intpage = intPageCount
-
case else
-
intpage = 1
-
If Request.QueryString("intpage") <> "" Then
-
intpage=Request.QueryString("intpage")
-
End If
-
end select
-
-
-
-
%>
-
-
-
-
..asp
Thanks a million
Richard
Richard,
I am a bit confused now. I understand what the current code is doing, but I am trying to figure out what you have and what you are actually trying to accomplish.
The snippet that you referred to that was provided by Jared is only that, a snippet. You would need to write more code to do anything with it. Please be more specific about what you expect to happen that isn't happening now.
Hi, The page as it stands is below. There is a loop in the table that populates the page with my card links together with popups. I am trying to add a dropdown list to the page with the cardDescription got from the database. What I want is to populate the page with all cards that correspond to each carddescription, so if 50 cards are categorized under abstract, that only those populate the page.
Basically trying to get the postcard id into a querystring and to get that to populate the page in the loop.
I have the dropdown on another page, although I want it on this page I was not able to get it working with the database connection.
So all the cards are in Categories...like categoryid=1,2,3,4,5 etc
then each has a card description cardDescription like "abstract","illustration" etc.
So it is to get the card associated with each card description to populate the page and I think that has to be done with the card ID. - .. ASP
-
-
-
<!--#Include File="art/dbconnect.asp"-->
-
<%
-
-
-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
' Product: Greeting Card Pro Version 2.1
-
' Author: AdComplete.com, LLC
-
' Date: January 21, 2002
-
' (c) Copyright 2000-2002 by AdComplete.com, LLC. All rights reserved.
-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-
-
lngCategoryID=CLng(Request("CategoryID"))
-
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
SQLQuery="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author,ThumbnailURL,AdvancedCard,ThumbnailHTML,Rnd([PostCardID]) From tblGreetingPostCards Where CategoryID=" & Clng(lngCategoryID) & " Order By Rnd([PostCardID])"
-
rsCard.Open SQLQuery, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
-
If rsCard.EOF=True Then
-
Response.Write "<p>No cards found in database for this category."
-
Response.End
-
End If
-
End If
-
-
'search feature
-
If Request("SearchWord") <> "" Then
-
strWd=Replace(Request("SearchWord"),"'","''")
-
strSQL="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author, "
-
strSQL=strSQL & " ThumbnailURL,AdvancedCard,ThumbnailHTML From tblGreetingPostCards Where Keywords Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultHeadline Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " CardDescription Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " Author Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultMessage Like '%" & strWD & "%' "
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
rsCard.Open strSQL, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
End If
-
-
strAddition="bgcolor=" & Chr(34) & Application("gcp_SearchPageBackgroundColor") & Chr(34)
-
strCategoryBarFontColor=Application("gcp_SearchPageFontBarColor")
-
strCategoryBarColor=Application("gcp_SearchPageBarColor")
-
-
'Retrieve Category Name
-
If lngCategoryID <> "" and lngCategoryID <> 0 Then
-
Set rsCat=connPostCardSoft.Execute("Select * From tblGreetingCategories Where CategoryID=" & Clng(lngCategoryID))
-
strCat="" & rsCat("CategoryName")
-
-
If rsCat("CategoryBackgroundImage")<> "" Then
-
strAddition="background=" & Chr(34) & rsCat("CategoryBackgroundImage") & Chr(34)
-
End If
-
If rsCat("CategoryBackgroundColor")<>"" Then
-
strAddition="bgcolor=" & Chr(34) & rsCat("CategoryBackgroundColor") & Chr(34)
-
End If
-
strCategoryBarFontColor=rsCat("CategoryBarFontColor")
-
strCategoryBarColor=rsCat("CategoryBarColor")
-
FontName=rsCat("FontName")
-
FontColor=rsCat("FontColor")
-
Else
-
strCat="Search results for:" & strWD
-
FontName=Application("gcp_FontName")
-
FontColor=Application("gcp_FontColor")
-
End If
-
-
-
Select Case Request("Action")
-
case " << "
-
intpage = 1
-
case " < "
-
intpage = Request("intpage")-1
-
if intpage < 1 then intpage = 1
-
case " > "
-
intpage = Request("intpage")+1
-
if intpage > intPageCount then intpage = IntPageCount
-
Case " >> "
-
intpage = intPageCount
-
case else
-
intpage = 1
-
If Request.QueryString("intpage") <> "" Then
-
intpage=Request.QueryString("intpage")
-
End If
-
end select
-
-
-
-
%>
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
<html>
-
-
-
<head>
-
<title><%=strCat%></title>
-
<meta name="description" content="art directory,painting,abstract,ceramics and ecards of quality contemporary artists.">
-
<meta http-equiv="cache-control" content="no-cache">
-
<meta http-equiv="pragma" content="no-cache">
-
<link rel="stylesheet" type="text/css" href="css/newwotartist.css">
-
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
-
<meta name="ProgId" content="FrontPage.Editor.Document">
-
<script src="/js/dw_event.js" type="text/javascript"></script>
-
<script src="/js/dw_tooltip.js" type="text/javascript"></script>
-
<script src="/js/dw_viewport.js" type="text/javascript"></script>
-
<script language="javascript">
-
<!--
-
-
function dept_onchange(frmSelect) {
-
frmSelect.submit();
-
}
-
-
//-->
-
</script>
-
-
<style type="text/css">
-
form.test {background: transparent;border-color: #000;padding-left:0px;padding-top:20px;font-size: 10px;}
-
select {width:100%;background-color:#303030;font-size: 10px;color:silver;}
-
option{background-color:#303030; font-size: 10px; color:silver;}
-
-
.texta {
-
font-size: 14px;
-
background-color: #c0c0c0;
-
border: 1px solid #808080;
-
-
width: 110px;
-
height: 18px;
-
}
-
#fixedtipdiv
-
{
-
position:absolute;
-
padding: 2px;
-
border:1px solid black;
-
font:normal 12px Verdana;
-
line-height:18px;
-
z-index:100;
-
}
-
div#tipDiv {
-
position:absolute; visibility:hidden; left:0; top:0; z-index:10000;
-
background-color:#efefef; border:1px solid #000;
-
width:180px; padding:6px;
-
color:#000; font-size:11px; line-height:1.3;
-
}
-
/* These are used in the wrapTipContent function */
-
div#tipDiv div.img { text-align:center }
-
div#tipDiv div.txt { text-align:center; margin-top:4px }
-
.silver{color:silver}
-
</style>
-
-
</head>
-
-
<body <%=strAddition%> text="<%=FontColor%>" link="<%=FontColor%>" vlink="<%=FontColor%>" alink="<%=FontColor%>">
-
<%=Application("gcp_HeaderHTML")%>
-
<div id="container">
-
<div id="outer">
-
<div id="topgap"></div>
-
<div id="contentt">
-
<div id="leftlogo"><div id="relative">
-
<img class="logo" border="0" src="/images2/wotartist1.jpg" alt="wotecard" title="wotecard" width="378" height="57">
-
</div></div>
-
<div id="greybox">
-
<ul id="navlist">
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=1" title="AMERICAS">AMERICAS</a></span></li>
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=2" title="UK">UK</a></span></li>
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=4" title="EUROPE">EUROPE</a></span></li>
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=3" title="AUSTRALIA">AUSTRALIA</a></span></li>
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=5" title="Asia & middle east">ASIA/MIDDLE EAST</a></span></li>
-
<li><span class="large"><a class="mena" href="/submit.asp" title="SUBMIT">submit</a></span></li>
-
<li><span class="large"><a class="mena" href="/submit.asp#a1" title="DONATE">donate</a></span></li>
-
<li><span class="large"><a class="mena" href="/websitedesign.asp" title="DESIGN"home>design</a></span></li>
-
<li><span class="large"><a class="mena" href="./" title="home">home</a></span></li>
-
</ul>
-
-
<tr>
-
<td width="545">
-
<div style="height:25px;"></div>
-
<form method="POST" action="directory.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" language="JavaScript">
-
<p align="left"><font face="Arial" size="2"></font>
-
<!--webbot bot="Validation" s-display-name="Search Word" b-value-required="TRUE" i-minimum-length="1" --><input type="text" class="texta" name="SearchWord" size="13">
-
<input type="image" SRC="art/images/button.gif" style="vertical-align:top;"value="Search" name="B1" width="60" height="22"></p>
-
</form>
-
</td>
-
</tr>
-
</div>
-
<div style="clear:both;"></div>
-
-
<div id="websites">
-
<p></p>
-
-
<%=request.QueryString("PostcardID")%>
-
-
-
<table width="100%">
-
-
-
-
<%
-
If Not rsCard.EOF Then
-
rsCard.AbsolutePage = intPage
-
-
-
For intRecord = 1 To rsCard.PageSize
-
CurrentColumn=1
-
%>
-
<tr>
-
-
<%
-
Do While CurrentColumn<=5
-
%>
-
<td><br><font size="2"><p></p>
-
<a onmouseover="doTooltip(event,'<img src="<%=Server.URLPathEncode(rsCard("ThumbnailURL"))%>" alt="" border="0"><div class="tp2"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></div>' )" onmouseout="hideTip()" href="http://<%=rsCard("DefaultHeadline")%>" target="_blank"><%=rsCard("CardDescription")%></a>
-
</font>
-
-
<p align="left"><font size="1"><span style="color : #303030;"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></font></span>
-
<p align="left"><font face="<%=FontName%>" size="1"><a href="card.asp?PostCardID=<%=rsCard("PostCardID")%>">
-
<I><%=rsCard("DefaultMessage")%></I><a>
-
-
-
</td>
-
<%
-
-
CurrentColumn=CurrentColumn+1
-
rsCard.MoveNext
-
If rsCard.EOF Then Exit For
-
Loop
-
%>
-
</tr>
-
-
<%
-
-
-
intRecord =intRecord +1
-
-
Next
-
End If
-
%>
-
-
</tr>
-
<tr>
-
<td colspan="5"><%If intpagecount > 1 Then %>
-
<font face="<%=FontName%>" size="1"><form name="MovePage" action="directory.asp?CategoryID=<%=lngCategoryID%>" method="post">
-
<input type="hidden" name="intpage" value="<%=intpage%>"><input type="hidden" name="SearchWord" value="<%=strWd%>"><div align="center"><center><p><br><input
-
type="submit" name="action" value=" << "> <input type="submit" name="action"
-
value=" < "> <input type="submit" name="action" value=" > "> <input type="submit"
-
name="action" value=" >> "><br>
-
Page: <%=Intpage & " of " & intpagecount%> <br>
-
</font></p>
-
-
</form>
-
<% End If %></td>
-
</tr>
-
<tr>
-
<td colspan="5"><br><br><br><br><p><font face="Arial" align="left" size="2"><br><font face="Arial" size="1">
-
<b>Important Copyright Notice!</b> The copyright of all images on this site is property of the respective artists. Any use or reproduction of the
-
content without prior written permission of the artist is strictly forbidden.
-
</font></p></td></tr>
-
-
</table>
-
<%=Application("gcp_FooterHTML")%>
-
-
-
-
</div>
-
<div style="clear:both;"> </div>
-
-
</div>
-
<div id="footer" ></div>
-
</div></div>
-
</body>
-
</html>
-
<% connPostCardSoft.Close()
-
Set connPostCardSoft=Nothing
-
Set rsCard=Nothing
-
Set rsCat=Nothing
-
%>
-
-
..ASP
the dropdown I got working on another page is - ..asp
-
-
-
-
<%@ Language=VBScript %>
-
<%Option explicit
-
Dim oRs, conn, connect, strSQL
-
-
set conn=server.CreateObject ("adodb.connection")
-
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/fpdb/greetingcardpro.mdb") & ";Persist Security Info=False"
-
conn.Open connect
-
-
%>
-
-
<html><head><title></title>
-
-
<script language="javascript">
-
<!--
-
-
function dept_onchange(frmSelect) {
-
frmSelect.submit();
-
}
-
-
//-->
-
</script>
-
-
</head>
-
<body>
-
<div id="menu">
-
<form method="Post">
-
<select name="navigate" onChange="window.location='manner.asp?PostCardID=' + this.options[this.selectedIndex].value">
-
-
<%
-
Set oRs=Server.CreateObject("adodb.recordset")
-
strSQL = "SELECT DISTINCT CardDescription FROM tblGreetingPostCards ORDER BY CardDescription"
-
oRs.Open strSQL, conn
-
-
Do while not oRs.EOF
-
if Request.Form("GreetingPostCards") = oRs("CardDescription") then 'if this is the selected one then display as selected
-
Response.Write "<OPTION VALUE = '" & oRS ("CardDescription") & "' SELECTED>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
else
-
Response.Write "<OPTION VALUE = '" & oRs ("CardDescription") & "'>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
end if
-
loop
-
%>
-
</SELECT>
-
</form>
-
</div>
-
</body>
-
</html>
-
-
-
..asp
I dont know if that makes sence.
Thanks again
Richard
Hi, The page as it stands is below. There is a loop in the table that populates the page with my card links together with popups. I am trying to add a dropdown list to the page with the cardDescription got from the database. What I want is to populate the page with all cards that correspond to each carddescription, so if 50 cards are categorized under abstract, that only those populate the page.
Basically trying to get the postcard id into a querystring and to get that to populate the page in the loop.
I have the dropdown on another page, although I want it on this page I was not able to get it working with the database connection.
So all the cards are in Categories...like categoryid=1,2,3,4,5 etc
then each has a card description cardDescription like "abstract","illustration" etc.
So it is to get the card associated with each card description to populate the page and I think that has to be done by associating each postcard ID with names in the carddescription. Maybe one should send the carddescription instead of id and in the query string, write if cardescription then cardID - .. ASP
-
-
-
<!--#Include File="art/dbconnect.asp"-->
-
<%
-
-
-
-
lngCategoryID=CLng(Request("CategoryID"))
-
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
SQLQuery="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author,ThumbnailURL,AdvancedCard,ThumbnailHTML,Rnd([PostCardID]) From tblGreetingPostCards Where CategoryID=" & Clng(lngCategoryID) & " Order By Rnd([PostCardID])"
-
rsCard.Open SQLQuery, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
-
If rsCard.EOF=True Then
-
Response.Write "<p>No cards found in database for this category."
-
Response.End
-
End If
-
End If
-
-
'search feature
-
If Request("SearchWord") <> "" Then
-
strWd=Replace(Request("SearchWord"),"'","''")
-
strSQL="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author, "
-
strSQL=strSQL & " ThumbnailURL,AdvancedCard,ThumbnailHTML From tblGreetingPostCards Where Keywords Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultHeadline Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " CardDescription Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " Author Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultMessage Like '%" & strWD & "%' "
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
rsCard.Open strSQL, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
End If
-
-
strAddition="bgcolor=" & Chr(34) & Application("gcp_SearchPageBackgroundColor") & Chr(34)
-
strCategoryBarFontColor=Application("gcp_SearchPageFontBarColor")
-
strCategoryBarColor=Application("gcp_SearchPageBarColor")
-
-
'Retrieve Category Name
-
If lngCategoryID <> "" and lngCategoryID <> 0 Then
-
Set rsCat=connPostCardSoft.Execute("Select * From tblGreetingCategories Where CategoryID=" & Clng(lngCategoryID))
-
strCat="" & rsCat("CategoryName")
-
-
If rsCat("CategoryBackgroundImage")<> "" Then
-
strAddition="background=" & Chr(34) & rsCat("CategoryBackgroundImage") & Chr(34)
-
End If
-
If rsCat("CategoryBackgroundColor")<>"" Then
-
strAddition="bgcolor=" & Chr(34) & rsCat("CategoryBackgroundColor") & Chr(34)
-
End If
-
strCategoryBarFontColor=rsCat("CategoryBarFontColor")
-
strCategoryBarColor=rsCat("CategoryBarColor")
-
FontName=rsCat("FontName")
-
FontColor=rsCat("FontColor")
-
Else
-
strCat="Search results for:" & strWD
-
FontName=Application("gcp_FontName")
-
FontColor=Application("gcp_FontColor")
-
End If
-
-
-
Select Case Request("Action")
-
case " << "
-
intpage = 1
-
case " < "
-
intpage = Request("intpage")-1
-
if intpage < 1 then intpage = 1
-
case " > "
-
intpage = Request("intpage")+1
-
if intpage > intPageCount then intpage = IntPageCount
-
Case " >> "
-
intpage = intPageCount
-
case else
-
intpage = 1
-
If Request.QueryString("intpage") <> "" Then
-
intpage=Request.QueryString("intpage")
-
End If
-
end select
-
-
-
-
%>
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
<html>
-
-
-
<head>
-
<title><%=strCat%></title>
-
<meta name="description" content="art directory,painting,abstract,ceramics and ecards of quality contemporary artists.">
-
<meta http-equiv="cache-control" content="no-cache">
-
<meta http-equiv="pragma" content="no-cache">
-
<link rel="stylesheet" type="text/css" href="css/newwotartist.css">
-
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
-
<meta name="ProgId" content="FrontPage.Editor.Document">
-
<script src="/js/dw_event.js" type="text/javascript"></script>
-
<script src="/js/dw_tooltip.js" type="text/javascript"></script>
-
<script src="/js/dw_viewport.js" type="text/javascript"></script>
-
<script language="javascript">
-
<!--
-
-
function dept_onchange(frmSelect) {
-
frmSelect.submit();
-
}
-
-
//-->
-
</script>
-
-
<style type="text/css">
-
form.test {background: transparent;border-color: #000;padding-left:0px;padding-top:20px;font-size: 10px;}
-
select {width:100%;background-color:#303030;font-size: 10px;color:silver;}
-
option{background-color:#303030; font-size: 10px; color:silver;}
-
-
.texta {
-
font-size: 14px;
-
background-color: #c0c0c0;
-
border: 1px solid #808080;
-
-
width: 110px;
-
height: 18px;
-
}
-
#fixedtipdiv
-
{
-
position:absolute;
-
padding: 2px;
-
border:1px solid black;
-
font:normal 12px Verdana;
-
line-height:18px;
-
z-index:100;
-
}
-
div#tipDiv {
-
position:absolute; visibility:hidden; left:0; top:0; z-index:10000;
-
background-color:#efefef; border:1px solid #000;
-
width:180px; padding:6px;
-
color:#000; font-size:11px; line-height:1.3;
-
}
-
/* These are used in the wrapTipContent function */
-
div#tipDiv div.img { text-align:center }
-
div#tipDiv div.txt { text-align:center; margin-top:4px }
-
.silver{color:silver}
-
</style>
-
-
</head>
-
-
<body <%=strAddition%> text="<%=FontColor%>" link="<%=FontColor%>" vlink="<%=FontColor%>" alink="<%=FontColor%>">
-
<%=Application("gcp_HeaderHTML")%>
-
<div id="container">
-
<div id="outer">
-
<div id="topgap"></div>
-
<div id="contentt">
-
<div id="leftlogo"><div id="relative">
-
<img class="logo" border="0" src="/images2/.jpg" alt="" title="" width="378" height="57">
-
</div></div>
-
<div id="greybox">
-
<ul id="navlist">
-
-
</ul>
-
-
<tr>
-
<td width="545">
-
<div style="height:25px;"></div>
-
<form method="POST" action="directory.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" language="JavaScript">
-
<p align="left"><font face="Arial" size="2"></font>
-
<!--webbot bot="Validation" s-display-name="Search Word" b-value-required="TRUE" i-minimum-length="1" --><input type="text" class="texta" name="SearchWord" size="13">
-
<input type="image" SRC="art/images/button.gif" style="vertical-align:top;"value="Search" name="B1" width="60" height="22"></p>
-
</form>
-
</td>
-
</tr>
-
</div>
-
<div style="clear:both;"></div>
-
-
<div id="websites">
-
<p></p>
-
-
<%=request.QueryString("PostcardID")%>
-
-
-
<table width="100%">
-
-
-
-
<%
-
If Not rsCard.EOF Then
-
rsCard.AbsolutePage = intPage
-
-
-
For intRecord = 1 To rsCard.PageSize
-
CurrentColumn=1
-
%>
-
<tr>
-
-
<%
-
Do While CurrentColumn<=5
-
%>
-
<td><br><font size="2"><p></p>
-
<a onmouseover="doTooltip(event,'<img src="<%=Server.URLPathEncode(rsCard("ThumbnailURL"))%>" alt="" border="0"><div class="tp2"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></div>' )" onmouseout="hideTip()" href="http://<%=rsCard("DefaultHeadline")%>" target="_blank"><%=rsCard("CardDescription")%></a>
-
</font>
-
-
<p align="left"><font size="1"><span style="color : #303030;"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></font></span>
-
<p align="left"><font face="<%=FontName%>" size="1"><a href="card.asp?PostCardID=<%=rsCard("PostCardID")%>">
-
<I><%=rsCard("DefaultMessage")%></I><a>
-
-
-
</td>
-
<%
-
-
CurrentColumn=CurrentColumn+1
-
rsCard.MoveNext
-
If rsCard.EOF Then Exit For
-
Loop
-
%>
-
</tr>
-
-
<%
-
-
-
intRecord =intRecord +1
-
-
Next
-
End If
-
%>
-
-
</tr>
-
<tr>
-
<td colspan="5"><%If intpagecount > 1 Then %>
-
<font face="<%=FontName%>" size="1"><form name="MovePage" action="directory.asp?CategoryID=<%=lngCategoryID%>" method="post">
-
<input type="hidden" name="intpage" value="<%=intpage%>"><input type="hidden" name="SearchWord" value="<%=strWd%>"><div align="center"><center><p><br><input
-
type="submit" name="action" value=" << "> <input type="submit" name="action"
-
value=" < "> <input type="submit" name="action" value=" > "> <input type="submit"
-
name="action" value=" >> "><br>
-
Page: <%=Intpage & " of " & intpagecount%> <br>
-
</font></p>
-
-
</form>
-
<% End If %></td>
-
</tr>
-
<tr>
-
<td colspan="5"><br><br><br><br><p><font face="Arial" align="left" size="2"><br><font face="Arial" size="1">
-
<b>.
-
</font></p></td></tr>
-
-
</table>
-
<%=Application("gcp_FooterHTML")%>
-
-
-
-
</div>
-
<div style="clear:both;"> </div>
-
-
</div>
-
<div id="footer" ></div>
-
</div></div>
-
</body>
-
</html>
-
<% connPostCardSoft.Close()
-
Set connPostCardSoft=Nothing
-
Set rsCard=Nothing
-
Set rsCat=Nothing
-
%>
-
-
..ASP
the dropdown I got working on another page is - ..asp
-
-
-
-
<%@ Language=VBScript %>
-
<%Option explicit
-
Dim oRs, conn, connect, strSQL
-
-
set conn=server.CreateObject ("adodb.connection")
-
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/fpdb/greetingcardpro.mdb") & ";Persist Security Info=False"
-
conn.Open connect
-
-
%>
-
-
<html><head><title></title>
-
-
<script language="javascript">
-
<!--
-
-
function dept_onchange(frmSelect) {
-
frmSelect.submit();
-
}
-
-
//-->
-
</script>
-
-
</head>
-
<body>
-
<div id="menu">
-
<form method="Post">
-
<select name="navigate" onChange="window.location='manner.asp?PostCardID=' + this.options[this.selectedIndex].value">
-
-
<%
-
Set oRs=Server.CreateObject("adodb.recordset")
-
strSQL = "SELECT DISTINCT CardDescription FROM tblGreetingPostCards ORDER BY CardDescription"
-
oRs.Open strSQL, conn
-
-
Do while not oRs.EOF
-
if Request.Form("GreetingPostCards") = oRs("CardDescription") then 'if this is the selected one then display as selected
-
Response.Write "<OPTION VALUE = '" & oRS ("CardDescription") & "' SELECTED>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
else
-
Response.Write "<OPTION VALUE = '" & oRs ("CardDescription") & "'>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
end if
-
loop
-
%>
-
</SELECT>
-
</form>
-
</div>
-
</body>
-
</html>
-
-
-
..asp
I dont know if that makes sence. I dont know if it can be done either. Maybe I have to get a dropdown thats linked with the same database link on the main page. That I havent been able to do so I linked from a seperate page, albeit with a different connection, still to the same database. Dont know if thats important.
probably confussed you even more.
Thanks again for your help
Richard
Richard,
Wait, let's see if I understand. There is one dropdown list that allows the user to select a category of postcard. You have this selection submitted to a second page where you want to display a dropdown list of all of the cards in that category. Please confirm that this is right.
I'm still not sure what part is giving you trouble. You got the first page to give you a dropdown list, right? Are you still not getting the second page to give you a list of the cards in that category?
Jared
Dear Jared, thanks for the reply. Not quite right.
I have a dropdown on one page populated with the carddescriptions from the database. I want to send the submitted selection to the next page to display in the table like other links display, not in another dropdown list. At the moment if you select abstract, what displays on the next page is simply the word abstract and not the sites that are listed in my database under that carddescription.
I need carddescription in the dropdown as they are the headings like abstract etc and I was led to believe that I needed to send the id to the next page to display the relevant sites.
So basically I need to send the id relevant to the selection, but when I tried that
with asp?cardID=xx, I just got xx appearing in the next page.
I dont know if that helps you to understand. I am stabbing in the dark trying to figure this out. basically if you visited wotartist .com you would see what I need to appear.
Thanks
Richard
I have a dropdown on one page populated with the carddescriptions from the database. I want to send the submitted selection to the next page to display in the table like other links display, not in another dropdown list. At the moment if you select abstract, what displays on the next page is simply the word abstract and not the sites that are listed in my database under that carddescription.
OK, not a big difference, I think I get you. maybe. The first page gets categories in a drop down select and the second displays a table with links to each of the art in that category. It looks like you have a good start, though. The first page already gives you a list of categories and the second page checks to make sure it was sent data (the response.write request.querystring line only checks to see if data was sent). The second page also opens the database, as I looked over the code. Does it not display anything from the database, or is it displaying stuff from the db that you didn't select? I couldn't tell. It looks to me like when the second page opens the db you want it to say this: -
strSQL = "SELECT * FROM tblGreetingPostCards WHERE CardDescription = '" & request.querystring("PostCardID") & "' ORDER BY Rnd([PostCardID])"
-
oRs.Open strSQL, conn 'this opens everything from the db that has
-
'CardDescription = the data sent from the first page. Then you need to put
-
'each link you get into a table
-
-
response.write "<table><tr>"
-
dim x
-
-
x = 0
-
-
Do while not oRs.EOF
-
x = x + 1
-
if x = 5 then
-
response.write "</tr><tr>" 'start a new row every five records
-
x = 0
-
end if
-
-
'I just pulled the content of the table cell from you code example %>
-
<td><br><font size="2"><p></p>
-
<a onmouseover="doTooltip(event,'<img
-
src="<%=Server.URLPathEncode(rsCard("ThumbnailURL"))%>" alt=""
-
border="0"><div class="tp2">
-
<%
-
If Trim(rsCard("Author"))<>"" Then %>
-
<%=rsCard("Author")%>
-
<%
-
End If %>
-
</div>' )"
-
onmouseout="hideTip()"
-
href="http://<%=rsCard("DefaultHeadline")%>"
-
target="_blank"><%=rsCard("CardDescription")%></a>
-
</font>
-
<p align="left"><font size="1"><span style="color : #303030;">
-
<%
-
If Trim(rsCard("Author"))<>"" Then %>
-
<%=rsCard("Author")%>
-
<%
-
End If %>
-
</font></span>
-
<p align="left"><font face="<%=FontName%>" size="1"><a
-
href="card.asp?PostCardID=<%=rsCard("PostCardID")%>">
-
<I><%=rsCard("DefaultMessage")%></I><a></td>
-
<%
-
oRs.MoveNext
-
loop
-
response.write "</tr></table>"
I need carddescription in the dropdown as they are the headings like abstract etc and I was led to believe that I needed to send the id to the next page to display the relevant sites.
So basically I need to send the id relevant to the selection, but when I tried that
with asp?cardID=xx, I just got xx appearing in the next page.
right, you need to send the thing the user selected in the first page to the second page, but all they actually selected is a card ID. You need to connect to the db again to see what the card ID means, ie "SELECT * FROM myTable WHERE cardID = " & request("dardID"). Does this make sense?
I dont know if that helps you to understand. I am stabbing in the dark trying to figure this out. basically if you visited wotartist .com you would see what I need to appear.
I checked out wotartist.com and I think I'm more confused than when I started. Is that supposed to be an example of how it is supposed to work, or is it a work in progress? I definitely don't see the problem you are describing. Is your script page in testing up at a URL where we can check it out?
Jared
Dear Jared, I have to thank you for your help.
www.wotartist. com/right.asp
is where I have the dropdown test popluated from the database. You will see when taken to the next test page, that you just get one carddescription shown. What I am trying to get happening is what happens when you search for a word or use the main country categories, that the page is populated with the relevant links to the category selected from the dropdown.
If you look at any country category on the site you will see that artists have a heading, eg, watercolor, abstract etc. It is those that I want to only appear when someone selects from the dropdown.
Thanks
Richard
a Ha! The problem is that you have an error on line 229. Which is line 229? it's one of these: - <%
-
If Not rsCard.EOF Then
-
rsCard.AbsolutePage = intPage
-
-
-
For intRecord = 1 To rsCard.PageSize
-
CurrentColumn=1
-
%>
There is some object definition missing, and this is always a tricky problem to find.
I notice the page is set up to either return search results or display results from a category. You have never tested it with search results though, right?
Jared
Hi Jared, Thats strange as line 229 is an empty line. This code finishes on line 228
<p align="left"><font size="1"><span style="color : #303030;"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></font></span>
<p align="left"><font face="<%=FontName%>" size="1"><a href="card.asp?PostCardID=<%=rsCard("PostCardID")% >">
<I><%=rsCard("DefaultMessage")%></I><a>
Thanks
Richard
Hi Jared, That error comes up if the page is accessed directly. ie manner.asp in the address bar. It doesnt occur if you search or enter by category, only if there is no object.
Thanks
Richard
Richard
BTW, what are you using to edit the page? some editors will number the lines for you, and they tend to be fairly accurate. I can think of a couple reasons your count may be a little off from what the server says, but there's an easy way to check. Put one more blank line before the line you think is causing the error, and one line after. If the line you thought is the problem really is the problem, the error message will now say the error is on line 230. If it is after that line, the error message will say line 231. If it is before that line, the error message will not change. My best guess is that the error is coming from this line:
put one blank line before and one after and see what the error message says.
Jared
Hi Jared, You are right, it didnt change but did when I added another blank line before the line you think is the problem
Thanks Richard
Hi Jared, You are right, it didnt change but did when I added another blank line before the line you think is the problem
Thanks Richard
so now it says the error is on line 231, which means the error is after the line I thought. I still think it has to be one of those four I said in post 16. Test it on the next line. What you are looking for is the line that makes the error line only go up one number.
Jared
Dear Jared, The error is on the line you thought, Its the only line that you put a blank line in front and it changes the error line. What that means I dont know, as there has always been an error message on the page when it is not populated with either a search query or a caregory id from my menu.
I think what you said earlier about the dropdown just sending the card id to the page and nothing else is true. One needs to do something with it once there.
Richard
Richard,
well, technically, this line is not required, you pulled up the list of categories from existing records, not from a separate list of categories, so which ever category they select there should ALWAYS be at least one record for that category, right? this line is saying "if there are records that match, then..." so put an apostrophe at the beginning of that line, and another at the beginning of the line which has the corresponding "end if". this makes the server ignore those lines. try it and see what it gives you.
Jared
Dear Jared, I tried that, It turned out the same just moved the error message to the next line. Today I set up another asp dropdown script and it fetched the id and description and category. Looking at the script I realized that The problem must lie in the response write.
The one I used today had this
strSQL = "SELECT * FROM tblGreetingPostCards where CategoryID='" & CategoryID &"'"
objRS.Open strSQL, objconn
Do While Not objRS.EOF
Response.Write objRs("PostCardID") & " " & objRs("Author") & " " & objRs("CategoryID") & "<br>"
objRS.MoveNext
Loop
Response.Write "</form>"
objRs.Close
Its not what would do what I want but before I simple had one line querystring. I think it should all work fine apart from getting the query response to do the same as what happens normally with the search and categories.
I dont know if you have any ideas. If not dont worry, you have put a lot of energy in so far, and thanks for that.
Richard
I just noticed that sometimes the querystring gives you "postCardID" and sometimes "cardDescription". What's the difference?
My best suggestion is to start over from the beginning. first, make sure the next page gets everything you sent: - dim x
-
for each x in request.querystring
-
response.write x & ": " & request.querystring(x) & "<br>" & vbNewLine
-
next
Then open the database just to make sure you can: - dim conn, rsCard
-
Set conn=Server.CreateObject("ADODB.Connection")
-
conn.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.open "SELECT * FROM tblGreetingPostCards", conn
-
-
for each x in rsCard.fields
-
response.write x.name & ": " & x.value & "<br>" & vbNewLine
-
next
-
this should list the first record in the table. (You'll still need to use your line that says what PostCardSoftConnectionString is, but that should be the only line from your original page you need) Let's make sure this works, then we'll try to get the right records displayed.
By the way, I should have asked sooner, do you have "option explicit" declared near the top of the page?
Jared
Dear Jared, Thats right, you can see that it lists all the data from the first record in the database. I am also declaring "option explicit" in the dropdown page. So things look like they are connected. It must be getting that info to loop through the right records and display correctly, thats the trick.
Thanks
Richard
OK, if I understand it right, the postCardID sent from the first page tells what the cardDescripton should be, right? So add this to the query statement. It should now read: - "SELECT * FROM tblGreetingPostCards WHERE cardDescription = '" & request("postCardID") & "'"
This will still only list one record, but it should always be one of the records you chose. Let me know if it works.
Jared
Dear Jared, This is what I have but I dont get anything now adding that line. stops showing the page so reverted to the previous move. Is it all in the right place anyway?
..asp
Thanks
Richard
Almost, you still need to say "conn" after the query -
rsCard.open "SELECT * FROM tblGreetingPostCards WHERE CardDescription = '" & request("PostCardID") & "'", conn
-
And when a change brings up a new error message, please mention that rather than just say it stopped displaying.
Jared
Dear Jared, Its as you said.
The error message is
ADODB.Recordset error '800a0cb3'
Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.
/manner.asp, line 235
As an experiment I nicked some code from another page and added it. Bobs your uncle it displays everything as should be. It does though not work when I take your code out. What I nicked and added is this.
<%
On Error Resume Next
'set database connection
Set conn=Server.CreateObject("ADODB.Connection")
conn.Mode = 3 '3 = adModeReadWrite
conn.Open PostCardSoftConnectString
strSQL1="Select Count(tblGreetingCategories.CategoryID) AS CountOfPostCardID From tblGreetingCategories"
Set rsTemp=conn.Execute(strSQL1)
If Not rsTemp.EOF Then
CountOfPostCardID=rsTemp("CountOfPostCardID")/2
End If
strSQL="SELECT tblGreetingCategories.CategoryID, tblGreetingCategories.CategoryName, "
strSQL=strSQL & " Count(tblGreetingPostCards.PostCardID) AS CountOfPostCardID "
strSQL=strSQL & " FROM tblGreetingCategories INNER JOIN tblGreetingPostCards ON "
strSQL=strSQL & " tblGreetingCategories.CategoryID = tblGreetingPostCards.CategoryID "
strSQL=strSQL & " GROUP BY tblGreetingCategories.CategoryID, tblGreetingCategories.CategoryName"
strSQL=strSQL & " Order By tblGreetingCategories.CategoryName ASC "
Set rsTemp=conn.Execute(strSQL)
strTemp=""
strTemp2=""
lngCount=1
Do While Not rsTemp.EOF
lngCount=lngCount+1
strCode=Replace(Ucase(Application("gcp_Application Path")),"PICKUP.ASP","showcards.asp")
strCode=strCode & "?CategoryID=" & rsTemp("CategoryID")
strCode=Lcase(strCode)
If Trim(strTemp)="" Then
strTemp="<a href=" & Chr(34) & strCode & Chr(34) & ">" & rsTemp("CategoryName") & "</a>" & " (" & rsTemp("CountOfPostCardID") & " Cards)"
Else
If lngCount>CountOfPostCardID+1 Then
If Trim(strTemp2)<>"" Then
strTemp2=strTemp2 & "<br>"
End If
strTemp2=strTemp2 & "<a href=" & Chr(34) & strCode & Chr(34) & ">" & rsTemp("CategoryName") & "</a>" & " (" & rsTemp("CountOfPostCardID") & " Cards)"
Else
strTemp=strTemp & "<br><a href=" & Chr(34) & strCode & Chr(34) & ">" & rsTemp("CategoryName") & "</a>" & " (" & rsTemp("CountOfPostCardID") & " Cards)"
End If
End If
rsTemp.MoveNext
Loop
Set rsTemp=Nothing
conn.Close()
Set conn=Nothing
%>
I got it from the display categories page, which I did a way with when I set this site us to my needs but in fact preceded the page I show the links on.
Its almost solved!!
How do I re-write the querystring so that the white text does not show and do you know what part of the code I added is making it work as some might be superflous?
www. wotartist.com/ right.asp
Thanks again
Richard
Its almost solved!!
How do I re-write the querystring so that the white text does not show and do you know what part of the code I added is making it work as some might be superflous?
www. wotartist.com/ right.asp
Thanks again
Richard
The ironic part is, it might be the "on error" line which fixed the whole thing. This just says "if there's an error, ignore it and keep going."
This is the part of the code that writes the white part -
for each x in rsCard.fields
-
response.write x.name & ": " & x.value & "<br>" & vbNewLine
-
next
I'm not sure what all you wrote that may be superfluous, it looks like the previous code you posted was written to handle several different scenarios, such as a search function, besides what we have been testing, but if you have streamlined the code already, you may have taken that out. It's kind of complex, so there may be nothing I can add. glad you got it going.
Jared
Dear Jared, You are right about the code being written for the different scenarios. I replaced the original code on the page with it and all the functions on the page like the search and categories work perfectly. So there is no streamlining to be done.
Thanks for you great help and detemination, I would have given up ages ago.
If you have a site I can link too I would be more than happy to link.
Thanks again
Richard
Dear Jared, I have just found a problem.
Firstly I was not able to swap the code. It didnt actually work. So now I still have the added stuff towards the bottom.
I was a bit precipitate in saying all worked well. Basically I forgot to redirect the main category links to the same page so they appeared to work when in fact they were on a different page.
if I take out the querystring, all works except the dropdown, and if I keep it in the dropdown works but nothing else.
So now its either or the dropdown works when the others dont and visa versa.
Is there a decraration in what I added to the page that could be included with the original script at the top?
Thanks
Richard
Dear Jared, Just to say thanks again for your help. I got it working after all.
Richard
Post your reply Sign in to post your reply or Sign up for a free account.
Similar topics
3 posts
views
Thread by Arpan |
last post: by
|
2 posts
views
Thread by Mikael |
last post: by
|
1 post
views
Thread by lion |
last post: by
|
5 posts
views
Thread by David |
last post: by
|
4 posts
views
Thread by Raterus |
last post: by
|
12 posts
views
Thread by Alex |
last post: by
|
3 posts
views
Thread by Dan Sikorsky |
last post: by
| |
4 posts
views
Thread by =?Utf-8?B?RVcgTmV3Ymll?= |
last post: by
| | | | | | | | | | | |