Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

&offset=1&offset=2 - Type mismatch: '[string: "1, 2"]'

Posted on 2011-10-17
5
Medium Priority
?
839 Views
Last Modified: 2012-06-21
I have an ASP VBscript recordset navigation bar like so -
< 1 | 2 | 3 | 4 > etc..

when 2 is clicked I get -

search=&offset=1
 this produces a correct page however when 3 is clicked I get -

search=&offset=1&offset=2

which results in the following error -

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[string: "1, 2"]'

/includes/RsProductSearchCount.asp, line 113

113 is -

MM_offset = Int(MM_param) of  - (code below)

Please advise - thanks


<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

  ' use index parameter if defined, otherwise use offset parameter
  MM_param = Request.QueryString("index")
  If (MM_param = "") Then
    MM_param = Request.QueryString("offset")
  End If
  If (MM_param <> "") Then
    MM_offset = Int(MM_param)
  End If

  ' if we have a record count, check if we are past the end of the recordset
  If (MM_rsCount <> -1) Then
    If (MM_offset >= MM_rsCount Or MM_offset = -1) Then  ' past end or move last
      If ((MM_rsCount Mod MM_size) > 0) Then         ' last page not a full repeat region
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' move the cursor to the selected record
  MM_index = 0
  While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1))
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend
  If (MM_rs.EOF) Then 
    MM_offset = MM_index  ' set MM_offset to the last possible record
  End If

End If
%>

Open in new window

0
Comment
Question by:garethtnash
  • 2
  • 2
5 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 1000 total points
ID: 36983069
Hi, I'm not 100% sure, but I would assume that this:
    MM_param = Request.QueryString("offset")

produces MM_param as an array, which would be
MM_param(0) = "1"
MM_param(1) = "2"

So you'd need to do something like
  If (MM_param <> "") Then
    If IsArray(MM_param) = False Then
       MM_offset = Int(MM_param)
    Else
       For Each intOffset In MM_param
           MM_offset = MM_param(intOffset)
           ' .... do other stuff here with each offset value
       Next
    End If
  End If

Open in new window


Hope that helps.

Rob.
0
 
LVL 9

Expert Comment

by:pritamdutt
ID: 36984036
Hi,

Please share the code used to generate the navigation bar < 1 | 2 | 3 | 4 >.

The problem lies in the logic used to generate Link URL for 1/2/3/4 in your navigation bar.



Regards,
0
 

Author Comment

by:garethtnash
ID: 36987620
Sorry for the delay guys, here is my code..

Thanks
<!--#include file="Connections/Connection.asp" -->
<!--#include file="WA_eCart/WA_eCart_Definition_VB.asp" -->
<!--#include file="WA_eCart/ShoppingCart_VB.asp" -->
<%

set CMDCategoryNav = Server.CreateObject("ADODB.Command")
CMDCategoryNav.ActiveConnection = MM_Connection_STRING
CMDCategoryNav.CommandText = "dbo.[Direct-Category-Navigation]"
CMDCategoryNav.CommandType = 4
CMDCategoryNav.CommandTimeout = 0
CMDCategoryNav.Prepared = true
CMDCategoryNav.Parameters.Append CMDCategoryNav.CreateParameter("RETURN_VALUE", 3, 4)
set CategoryNav = CMDCategoryNav.Execute
CategoryNav_numRows = 0

%>
<%

set CMDDisplaySpecialOffers = Server.CreateObject("ADODB.Command")
CMDDisplaySpecialOffers.ActiveConnection = MM_Connection_STRING
CMDDisplaySpecialOffers.CommandText = "dbo.DirectShowSpecialOffers"
CMDDisplaySpecialOffers.CommandType = 4
CMDDisplaySpecialOffers.CommandTimeout = 0
CMDDisplaySpecialOffers.Prepared = true
CMDDisplaySpecialOffers.Parameters.Append CMDDisplaySpecialOffers.CreateParameter("RETURN_VALUE", 3, 4)
set DisplaySpecialOffers = CMDDisplaySpecialOffers.Execute
DisplaySpecialOffers_numRows = 0

%>
<%
Dim RsProductSearch
Dim RsProductSearch_cmd
Dim RsProductSearch_numRows


Set RsProductSearch_cmd = Server.CreateObject ("ADODB.Command")
RsProductSearch_cmd.ActiveConnection = MM_Connection_STRING
RsProductSearch_cmd.CommandText = "Select DISTINCT P.ID, P.[Product-Name], LEFT(P.[Product-Description],40)+'..' AS Description, Case When P.[Display--Special-Price]='Y' then DP.[Special-Price] Else DP.[Normal-Price] end AS Price, Case When P.[Display--Special-Price]='Y' then DP.[Normal-Price] end AS  OriginalPrice, I.Image, P.SKUCode from dbo.[Direct-Product] P inner join dbo.[Direct-Product-Image] I on I.ProductID = P.ID inner join dbo.[Direct-Product-Price] DP on DP.[Product-ID] = P.ID inner join dbo.[Direct-Product-Category] DPC on DPC.[Product-ID] = P.ID inner join dbo.[Direct-Category] C on C.ID = DPC.[Category-ID] inner join dbo.[Nominal-Codes] NC ON P.NominalCodeID = NC.ID Where P.StockCount >= 1 AND P.[Display--Direct] = 'Y' AND I.[Default-Image] = 'Y' order by P.ID desc" 
RsProductSearch_cmd.Prepared = true

Set RsProductSearch = RsProductSearch_cmd.Execute
RsProductSearch_numRows = 0
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim RsProductSearch_total
Dim RsProductSearch_first
Dim RsProductSearch_last

' set the record count
RsProductSearch_total = RsProductSearch.RecordCount

' set the number of rows displayed on this page
If (RsProductSearch_numRows < 0) Then
  RsProductSearch_numRows = RsProductSearch_total
Elseif (RsProductSearch_numRows = 0) Then
  RsProductSearch_numRows = 1
End If

' set the first and last displayed record
RsProductSearch_first = 1
RsProductSearch_last  = RsProductSearch_first + RsProductSearch_numRows - 1

' if we have the correct record count, check the other stats
If (RsProductSearch_total <> -1) Then
  If (RsProductSearch_first > RsProductSearch_total) Then
    RsProductSearch_first = RsProductSearch_total
  End If
  If (RsProductSearch_last > RsProductSearch_total) Then
    RsProductSearch_last = RsProductSearch_total
  End If
  If (RsProductSearch_numRows > RsProductSearch_total) Then
    RsProductSearch_numRows = RsProductSearch_total
  End If
End If
%>

<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (RsProductSearch_total = -1) Then

  ' count the total records by iterating through the recordset
  RsProductSearch_total=0
  While (Not RsProductSearch.EOF)
    RsProductSearch_total = RsProductSearch_total + 1
    RsProductSearch.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (RsProductSearch.CursorType > 0) Then
    RsProductSearch.MoveFirst
  Else
    RsProductSearch.Requery
  End If

  ' set the number of rows displayed on this page
  If (RsProductSearch_numRows < 0 Or RsProductSearch_numRows > RsProductSearch_total) Then
    RsProductSearch_numRows = RsProductSearch_total
  End If

  ' set the first and last displayed record
  RsProductSearch_first = 1
  RsProductSearch_last = RsProductSearch_first + RsProductSearch_numRows - 1
  
  If (RsProductSearch_first > RsProductSearch_total) Then
    RsProductSearch_first = RsProductSearch_total
  End If
  If (RsProductSearch_last > RsProductSearch_total) Then
    RsProductSearch_last = RsProductSearch_total
  End If

End If
%>
<%
Dim MM_paramName 
%>
<%
' *** Move To Record and Go To Record: declare variables

Dim MM_rs
Dim MM_rsCount
Dim MM_size
Dim MM_uniqueCol
Dim MM_offset
Dim MM_atTotal
Dim MM_paramIsDefined

Dim MM_param
Dim MM_index

Set MM_rs    = RsProductSearch
MM_rsCount   = RsProductSearch_total
MM_size      = RsProductSearch_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
  MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

  ' use index parameter if defined, otherwise use offset parameter
  MM_param = Request.QueryString("index")
  If (MM_param = "") Then
    MM_param = Request.QueryString("offset")
  End If
  If (MM_param <> "") Then
    MM_offset = Int(MM_param)
  End If

  ' if we have a record count, check if we are past the end of the recordset
  If (MM_rsCount <> -1) Then
    If (MM_offset >= MM_rsCount Or MM_offset = -1) Then  ' past end or move last
      If ((MM_rsCount Mod MM_size) > 0) Then         ' last page not a full repeat region
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' move the cursor to the selected record
  MM_index = 0
  While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1))
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend
  If (MM_rs.EOF) Then 
    MM_offset = MM_index  ' set MM_offset to the last possible record
  End If

End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

  ' walk to the end of the display range for this page
  MM_index = MM_offset
  While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size))
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend

  ' if we walked off the end of the recordset, set MM_rsCount and MM_size
  If (MM_rs.EOF) Then
    MM_rsCount = MM_index
    If (MM_size < 0 Or MM_size > MM_rsCount) Then
      MM_size = MM_rsCount
    End If
  End If

  ' if we walked off the end, set the offset based on page size
  If (MM_rs.EOF And Not MM_paramIsDefined) Then
    If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
      If ((MM_rsCount Mod MM_size) > 0) Then
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' reset the cursor to the beginning
  If (MM_rs.CursorType > 0) Then
    MM_rs.MoveFirst
  Else
    MM_rs.Requery
  End If

  ' move the cursor to the selected record
  MM_index = 0
  While (Not MM_rs.EOF And MM_index < MM_offset)
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend
End If
%>
<%
' *** Move To Record: update recordset stats

' set the first and last displayed record
RsProductSearch_first = MM_offset + 1
RsProductSearch_last  = MM_offset + MM_size

If (MM_rsCount <> -1) Then
  If (RsProductSearch_first > MM_rsCount) Then
    RsProductSearch_first = MM_rsCount
  End If
  If (RsProductSearch_last > MM_rsCount) Then
    RsProductSearch_last = MM_rsCount
  End If
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
  MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_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)
End If
If (MM_keepURL <> "")  Then
  MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
  MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' 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
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links

Dim MM_keepMove
Dim MM_moveParam
Dim MM_moveFirst
Dim MM_moveLast
Dim MM_moveNext
Dim MM_movePrev

Dim MM_urlStr
Dim MM_paramList
Dim MM_paramIndex
Dim MM_nextParam

MM_keepMove = MM_keepBoth
MM_moveParam = "index"

' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 1) Then
  MM_moveParam = "offset"
  If (MM_keepMove <> "") Then
    MM_paramList = Split(MM_keepMove, "&")
    MM_keepMove = ""
    For MM_paramIndex = 0 To UBound(MM_paramList)
      MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1)
      If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then
        MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex)
      End If
    Next
    If (MM_keepMove <> "") Then
      MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
    End If
  End If
End If

' set the strings for the move to links
If (MM_keepMove <> "") Then 
  MM_keepMove = Server.HTMLEncode(MM_keepMove) & "&"
End If

MM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="

MM_moveFirst = MM_urlStr & "0"
MM_moveLast  = MM_urlStr & "-1"
MM_moveNext  = MM_urlStr & CStr(MM_offset + MM_size)
If (MM_offset - MM_size < 0) Then
  MM_movePrev = MM_urlStr & "0"
Else
  MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)
End If
%>
<!--#include file="includes/PageSession.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- notes here -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title> Direct - <!--#include file="includes/Results-header.asp" --></title>
<!-- notes here -->
<meta name="robots" content="noindex, nofollow">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/nav-menus.css" rel="stylesheet" type="text/css" />
<link href="css/jqtransform.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/stuHover.js"></script>
<script type="text/javascript" src="js/jquery.jqtransform.js"></script>
<script language="javascript" type="text/javascript" src="/js/js-search.js"></script>
<script type="text/javascript" src="analytics/google-analytics.js"></script>
</head>
<body>
<div class="wrap" id="three_columns">
<!-- notes here -->
<div id="head">
    <h1 class="logo"><a href="default.asp"><span> Direct</span></a></h1>
    <div class="basket"><%If WA_eCart_TotalColumn(ShoppingCart, "Quantity") > 0 then%><a href="cart.asp"><span>Shopping Basket</span></a><%Else%><a href="#"><span>Shopping Basket</span></a><%End if%>
      <p><%=WA_eCart_TotalColumn(ShoppingCart, "Quantity")%> Item<%If WA_eCart_TotalColumn(ShoppingCart, "Quantity") > 1 then%>s<%End if%>: <strong><%=WA_eCart_DisplayMoney(ShoppingCart, WA_eCart_GrandTotal(ShoppingCart))%></strong></p>
    </div>
    <div id="search">
      <form id="searchform" name="searchform" action="products.asp">
        <input name="search" type="text" tabindex="1" onblur="if (this.value==''){this.value='enter a keyword or an item #'};" onfocus="if(this.value=='enter a keyword or an item #'){this.value=''};" value="enter a keyword or an item #" />
        <input name="searchbut" type="submit" value="" class="button" />
      </form>
    </div>
  </div>
  <!-- notes here -->
<div id="main_nav">
    <div class="user_nav"><a href="#">Return to Dashboard</a></div>
    <ul id="nav">
      <li class="top"><a href="default.asp" class="top_link"><span>Home</span></a></li>
      <li class="top"><a href="products.asp" class="top_link"><span>Products</span></a></li>
      <li class="top"><a href="#" class="top_link"><span>Category1</span></a></li>
      <li class="top"><a href="#" class="top_link"><span>Category2</span></a></li>
      <li class="top"><a href="#" class="top_link"><span>MembersForum</span></a></li>
      <li class="top"><a href="#" class="top_link"><span>OnlinePrint</span></a></li>
      <li class="top"><a href="#" class="top_link"><span>ENewsletter</span></a></li>
      <li class="top"><a href="#" class="top_link"><span>Contact</span></a></li>
    </ul>
  </div>
  <div class="content clearfix">
   <!--#include file="prts/leftcolumn.asp" -->
    <div class="main_content">
      <div class="bredcrum"><a href="#"> Direct</a> &gt; <a href="products.asp">Product Search</a></div>
        <!-- notes here -->
        <h1 class="page_title"><%If left(Request.ServerVariables("QUERY_STRING"),2) = "sp" then%>Special Offers
<%ElseIf left(Request.ServerVariables("QUERY_STRING"),2) = "cs" then%>Coming Soon
<%ElseIf left(Request.ServerVariables("QUERY_STRING"),2) = "p=" then%>Related Products
<%ElseIf Request("t") <> "" then%><%=Request("t")%>
<%ElseIf Request("t") = "" AND NOT left(Request.ServerVariables("QUERY_STRING"),3) = "cs=" AND NOT left(Request.ServerVariables("QUERY_STRING"),3) = "sp=" then%> Product Search
<%End if%></h1>
        <!-- notes here -->
        <p>A selection of <%If left(Request.ServerVariables("QUERY_STRING"),2) = "sp" then%>Special Offers
<%ElseIf left(Request.ServerVariables("QUERY_STRING"),2) = "cs" then%>Coming Soon
<%ElseIf left(Request.ServerVariables("QUERY_STRING"),2) = "p=" then%>Related Products
<%ElseIf Request("t") <> "" then%><%=Request("t")%>
<%ElseIf Request("t") = "" AND NOT left(Request.ServerVariables("QUERY_STRING"),3) = "cs=" AND NOT left(Request.ServerVariables("QUERY_STRING"),3) = "sp=" then%> Product Search
<%End if%> offers are listed below;</p>
  <!-- notes here -->
  <% If (RsProductSearch_total) > 9 Then %>
<div class="pagination"> 
<ul class="page_nav">
<% If MM_offset <> 0 Then %>
<li class="prev"><a href="<%=MM_movePrev%>">Prev</a></li>
<% End If ' end MM_offset <> 0 %>
<%
TFM_MiddlePages = 7
TFM_delimiter = ""
TFM_startLink = MM_offset + 1 - MM_size * (int(TFM_middlePages/2))
If MM_offset > 0 Then TFM_LimitPageEndCount = int(TFM_startLink/MM_size)
If TFM_startLink < 1 Then 
TFM_startLink = 1
TFM_LimitPageEndCount = 0
End If
TFM_endLink = MM_size * TFM_MiddlePages + TFM_startLink - 1
If TFM_endLink > RsProductSearch_total Then TFM_endLink = RsProductSearch_total 
For i = TFM_startLink to TFM_endLink Step MM_size
TFM_LimitPageEndCount = TFM_LimitPageEndCount + 1
if i <> MM_offset + 1 Then
Response.Write("<li><a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & i-1 & """>")
Response.Write(TFM_LimitPageEndCount & "</a></li>")
else
Response.Write("<li class=""current_page""><a href=""#"">")
Response.Write(TFM_LimitPageEndCount & "</a></li>")
End if
if(i <= TFM_endLink - MM_size) then Response.Write(TFM_delimiter)
Next
%>
<% If Not MM_atTotal Then %>
<li class="next"><a href="<%=MM_moveNext%>">Next</a></li>
<% End If ' end Not MM_atTotal %>
</ul>
</div>
<%End if%>
      <div class="products_list">
        <div class="row">
  <!-- notes here -->
            <%
Dim Repeat3__numRows
Dim Repeat3__index

Repeat3__numRows = 9
Repeat3__index = 0
RsProductSearch_numRows = RsProductSearch_numRows + Repeat3__numRows
%><% 
While ((Repeat3__numRows <> 0) AND (NOT RsProductSearch.EOF)) 
%>
  <div class="asinItem">
    <div class="Product-Holder">
      <div class="prodImage"><a href="detail.asp?p=<%=(RsProductSearch.Fields.Item("ID").Value)%>"><img src="<%="http://mi.url.com/product-images/"+(RsProductSearch.Fields.Item("Image").Value)%>" alt="<%=(RsProductSearch.Fields.Item("Product-Name").Value)%>" border="0" /></a></div>
      <div class="Product-Holder-Title"><h3><a href="detail.asp?p=<%=(RsProductSearch.Fields.Item("ID").Value)%>"><%=(RsProductSearch.Fields.Item("Product-Name").Value)%></a></h3></div>
      <div class="Product-Holder-Description"><h3><a href="detail.asp?p=<%=(RsProductSearch.Fields.Item("ID").Value)%>"><%=(RsProductSearch.Fields.Item("Description").Value)%></a></h3></div>
      <div class="Product-Holder-Price"><h3><a href="detail.asp?p=<%=(RsProductSearch.Fields.Item("ID").Value)%>">From <% IF RsProductSearch.Fields.Item("OriginalPrice") <> "" Then %><span class="strikethroughprice">&pound;<%=(RsProductSearch.Fields.Item("OriginalPrice").Value)%></span><%End if%>
        <strong>&pound;<%=(RsProductSearch.Fields.Item("Price").Value)%></strong></a></h3></div>
      <div class="add-to-basket"><a href="detail.asp?p=<%=(RsProductSearch.Fields.Item("ID").Value)%>"><img src="images/add-to-basket_btn.png" alt="Add to Basket" width="102" height="23" border="0" /></a></div>
      </div>
  </div>
  <% 
  Repeat3__index=Repeat3__index+1
  Repeat3__numRows=Repeat3__numRows-1
  RsProductSearch.MoveNext()
Wend
%>
        </div>
        <div class="row"></div>
        <div class="row end">&nbsp;</div>
      </div>
  <!-- notes here -->
  <% If (RsProductSearch_total) > 9 Then %>
<div class="pagination"> 
<ul class="page_nav">
<% If MM_offset <> 0 Then %>
<li class="prev"><a href="<%=MM_movePrev%>">Prev</a></li>
<% End If ' end MM_offset <> 0 %>
<%
TFM_MiddlePages = 7
TFM_delimiter = ""
TFM_startLink = MM_offset + 1 - MM_size * (int(TFM_middlePages/2))
If MM_offset > 0 Then TFM_LimitPageEndCount = int(TFM_startLink/MM_size)
If TFM_startLink < 1 Then 
TFM_startLink = 1
TFM_LimitPageEndCount = 0
End If
TFM_endLink = MM_size * TFM_MiddlePages + TFM_startLink - 1
If TFM_endLink > RsProductSearch_total Then TFM_endLink = RsProductSearch_total 
For i = TFM_startLink to TFM_endLink Step MM_size
TFM_LimitPageEndCount = TFM_LimitPageEndCount + 1
if i <> MM_offset + 1 Then
Response.Write("<li><a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & i-1 & """>")
Response.Write(TFM_LimitPageEndCount & "</a></li>")
else
Response.Write("<li class=""current_page""><a href=""#"">")
Response.Write(TFM_LimitPageEndCount & "</a></li>")
End if
if(i <= TFM_endLink - MM_size) then Response.Write(TFM_delimiter)
Next
%>
<% If Not MM_atTotal Then %>
<li class="next"><a href="<%=MM_moveNext%>">Next</a></li>
<% End If ' end Not MM_atTotal %>
</ul>
</div>
<%End if%>
  <!-- notes here -->
        <% If (Not DisplaySpecialOffers.EOF Or Not DisplaySpecialOffers.BOF) AND NOT left(Request.ServerVariables("QUERY_STRING"),3) = "sp=" Then %>
  <div class="products_box featured">
    <h2 class="box_title"><a href="../products.asp?sp=1"><span>Browse Special Offers</span></a> Special Offers</h2>
    <div class="products_content">
      <div class="top_gradient clearfix">
       <%
Dim Repeat2__numRows
Dim Repeat2__index

Repeat2__numRows = 3
Repeat2__index = 0
DisplaySpecialOffers_numRows = DisplaySpecialOffers_numRows + Repeat2__numRows
%>
<% 
While ((Repeat2__numRows <> 0) AND (NOT DisplaySpecialOffers.EOF)) 
%>
          <div class="asinItem">
            <div class="Product-Holder">
              <div class="prodImage"><a href="detail.asp?p=<%=(DisplaySpecialOffers.Fields.Item("ID").Value)%>"><img src="<%="http://mi.url.com/product-images/"+(DisplaySpecialOffers.Fields.Item("Image").Value)%>" alt="<%=(DisplaySpecialOffers.Fields.Item("Product-Name").Value)%>" border="0" /></a></div>
              <div class="Product-Holder-Title"><h3><a href="detail.asp?p=<%=(DisplaySpecialOffers.Fields.Item("ID").Value)%>"><%=(DisplaySpecialOffers.Fields.Item("Product-Name").Value)%></a></h3></div>
              <div class="Product-Holder-Description"><h3><a href="detail.asp?p=<%=(DisplaySpecialOffers.Fields.Item("ID").Value)%>"><%=(DisplaySpecialOffers.Fields.Item("Description").Value)%></a></h3></div>
              <div class="Product-Holder-Price"><h3><a href="detail.asp?p=<%=(DisplaySpecialOffers.Fields.Item("ID").Value)%>">From <% IF DisplaySpecialOffers.Fields.Item("OriginalPrice") <> "" Then %><span class="strikethroughprice">&pound;<%=(DisplaySpecialOffers.Fields.Item("OriginalPrice").Value)%></span><%End if%>
        <strong>&pound;<%=(DisplaySpecialOffers.Fields.Item("Price").Value)%></strong></a></h3></div>
              <div class="add-to-basket"><a href="detail.asp?p=<%=(DisplaySpecialOffers.Fields.Item("ID").Value)%>"><img src="images/add-to-basket_btn.png" alt="Add to Basket" width="102" height="23" border="0" /></a></div>
            </div>
          </div>
          <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  DisplaySpecialOffers.MoveNext()
Wend
%>
        <div class="row end">&nbsp;</div>
      </div>
    </div>
  </div>
  <% End If ' end Not DisplaySpecialOffers.EOF Or NOT DisplaySpecialOffers.BOF %>
    </div>
    <!--#include file="prts/rightcolumn.asp" -->
  </div>
<!--#include file="prts/foot.asp" -->
</div>
</body>
</html>
<%
RsProductSearch.Close()
Set RsProductSearch = Nothing
%>

Open in new window

0
 
LVL 9

Assisted Solution

by:pritamdutt
pritamdutt earned 1000 total points
ID: 36988290
Since it is not possible for me to execute the code u have given I would request you to Debug and Print the

Request.ServerVariables("URL")  Value just before 446 and 515. I am interested in checking for existence of offset in the URL

Line 446: Response.Write("<li><a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & i-1 & """>")

Line 515: Response.Write("<li><a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & i-1 & """>")


Regards,
0
 

Author Comment

by:garethtnash
ID: 36988429
Hi Pritamdutt,

Thank you, but I have found the solution, mainly ...

My repeat declarations --

<%
Dim Repeat3__numRows
Dim Repeat3__index

Repeat3__numRows = 9
Repeat3__index = 0
RsProductSearch_numRows = RsProductSearch_numRows + Repeat3__numRows
%>

Needed to be above the code from rows 44 - 358....

It is all working fine now, thank you for your time and effort :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question