I'm new to working with asp, but have worked with UltraDev 4 for awhile. Here is my problem:
I have a product_list.asp page that lists, among other things, the merchant and the product title. Both are clickable links.
Clicking on the merchant link correctly takes one to the merchant_detail.asp page with all content/data shown correctly.
Clicking on the product title correctly take me to the product_details.asp page but on that page I also have the merchant name displayed.
The problem I am having is that the merchant name is not showing up accurately. It is not giving me the merchant name that correctly corresponds to the product title. I'm just getting a name out of the database and it is the same name regardless of what product title I click on in the product_list.asp page.
If you would like to look at the code UltraDev generates here is the top section of product_list.asp:
<%
set rsProducts = Server.CreateObject("ADODB
.Recordset
")
rsProducts.ActiveConnectio
n = MM_dsnMarketplace_STRING
rsProducts.Source = "SELECT Merchants.Merchants, ProductList.Image, ProductList.ProductID, ProductList.ProdTitle, ProductList.Description, ProductList.CategoryID, ProductList.SupplierID, ProductList.SerialNum, ProductList.ProdType, ProductList.SalePrice, ProductList.UnitPrice, ProductList.ProdTitle, * FROM Merchants INNER JOIN ProductList ON Merchants.SupplierID = ProductList.SupplierID WHERE (([ProductList]![CategoryI
D]='Angel'
)) ORDER BY ProductList.ProdTitle"
rsProducts.CursorType = 0
rsProducts.CursorLocation = 2
rsProducts.LockType = 3
rsProducts.Open()
rsProducts_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
rsProducts_numRows = rsProducts_numRows + Repeat1__numRows
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm=
"":MM_keep
Both="":MM
_keepNone=
""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,Nex
tItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.Q
ueryString
(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,Nex
tItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.F
orm(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
and here is the body:
<p class="heading1"><%=(rsPro
ducts.Fiel
ds.Item("C
ategoryID"
).Value)%>
Product List:</p>
<table width="90%" border="0" cellspacing="0" cellpadding="3">
<tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsProducts.EOF))
%>
<td>
<p><img src="<%=(rsProducts.Fields
.Item("Ima
ge").Value
)%>">
<br>
<b>Title:</b> <A HREF="product_details.asp?
<%= MM_keepNone & MM_joinChar(MM_keepNone) & "ProductID=" & rsProducts.Fields.Item("Pr
oductID").
Value %>"></A><%=(rsProducts.Fie
lds.Item("
ProdTitle"
).Value)%>
<br>
<b>Type:</b> <%=(rsProducts.Fields.Item
("ProdType
").Value)%
> <br>
<b>Created By: </b><A HREF="merchant_detail.asp?
<%= MM_keepNone & MM_joinChar(MM_keepNone) & "SupplierID=" & rsProducts.Fields.Item("Su
pplierID")
.Value %>"><%=(rsProducts.Fields.
Item("Merc
hants").Va
lue)%></A>
</p>
<p> </p>
</td>
<%
Repeat1__index=Repeat1__in
dex+1
Repeat1__numRows=Repeat1__
numRows-1
rsProducts.MoveNext()
Wend
%>
Thank you for your help.
Michael