Forum Moderators: open
For instance the site now will pull up a category for the page to display.. lets say it pulls up the category "seafood" ..it displays the category in the body and all is well but if I try to copy and paste that into the title it doesn't work and I get an error. so I tried putting the <%=rs("category") %> into the title but to no avail.
Also the ASP code is all under the title tags if that means anything..i tried switching the position of the title tag to go under the ASP query string etc.. but that didn't work eiither... IM NO asp whiz but any tips would be appreciated.
I wold post the code for the ASP page but dont know if thats allowed?
From your description, your ASP code is below the body tag. ASP code is processed inline, top to bottom, in source order.
You can't use any variables or data in the ASP code before the code has actually run, so you need to re-arrange your ASP/HTML to put the connection and recordset opening bits of the ASP code above the title element.
If you want to post a short, relevant excerpt of your code so someone can assist you further, you can do so - just don't post the whole page!
<td class="searchfields" width=8 background=./images/det_midlft.gif><img height=1
src="./images/pixel-clr.gif" width=8></td>
<td class="searchfields" width="310"><b><% if session("frontuserid") <> "" then %><%=rs("address") %>, <% end if %><%= rs("area") %>,
<%= rs("city") %> - $<%= Currency_Format_Function(rs("rent")) %>/Mo.</b></td>
<td class="searchfields" width="239">
<div align="right"><img src="./images/printer.gif" style="cursor:hand" onClick="printpage()" width="15" height="20" align="absmiddle">
<A onClick="printpage()" style="cursor:hand">Print Page</a> <A href="email_to_friend.asp?id=<%= request("id") %>"><img border="0" src="./images/email.gif" width="16" height="16" align="absmiddle"></a>
<%=rs("address") %> .. that it what I want to be pulled into the title
<edited>
I would want that in the title. Is the only way to accomplish this is by rearranging the code as stated earlier?
<Sorry, no keywords or links.
See Forum Charter [webmasterworld.com]>
[edited by: tedster at 9:13 pm (utc) on May 10, 2007]
You need to find the bit of your ASP code where the connection and recordset are opened: it may be in the page higher up than your excerpt, or in an include file.
The code will include something like:
Set Something = Server.CreateObject("ADODB.Connection")
(search for the second bit "ADODB.Connection")
It should be a quick, straightforward job for a programmer to implement what you're looking for, so it may be easier to get your web developer to do it if you're unfamiliar with programming. HTH.
As mattur's said, it should be a really quick change for someone to do. Worst case, rearrange your code logic so the recordset is opened (and closed) before you start using any HTML, instead using variables to contain the values you want from the DB.
Eg.
<%
open recordset
Dim sAddress
sAddress = oRS("address")
sArea = oRS("area")
sCity = oRS("city")
iID = oRS("id")
cRent = oRS("rent")
close recordset
%>
<html>
<head>
<title><%=sAddress%></title>
</head>
...
<td class="searchfields" width=8 background=./images/det_midlft.gif>
<img height=1
src="./images/pixel-clr.gif" width=8>
</td>
<td class="searchfields" width="310">
<b><% if session("frontuserid") <> "" then %><%=sAddress%>, <% end if %><%=sArea%>,
<%=sCity%> - $<%= Currency_Format_Function(cRent) %>/Mo.</b>
</td>
<td class="searchfields" width="239">
<div align="right"><img src="./images/printer.gif" style="cursor:hand" onClick="printpage()" width="15" height="20" align="absmiddle">
<A onClick="printpage()" style="cursor:hand">Print Page</a>
<A href="email_to_friend.asp?id=<%=iID%>"><img border="0" src="./images/email.gif" width="16" height="16" align="absmiddle"></a>
...
</html>