SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Numbers and QueryStrings

    Hi There,

    I have a small problem I can't seem to work out (Prob simple).

    I'm trying to set a variable so if it's less than do this e.g.

    Code:
    <%
    Dim Offset
    Offset = Request.QueryString("offset")
    Dim LastPage
    LastPage = 'This could be any number lets say 15
    
    If Offset < LastPage Then
       Response.Write "<td><a href=''>Next</a></td>"
    Else
       Response.Write "<td>Next</td>" ' This would disable the link
    End If
    %>
    However this doesnt work, but if I do . . . .

    Code:
    <%
    If Offset < 15 Then 'Force the number then this works
       Response.Write "<td><a href=''>Next</a></td>"
    Else
       Response.Write "<td>Next</td>" ' This would disable the link
    End If
    %>
    The the number may not be 15 each time, How can I get this to work.

    Thanks

  2. #2
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also,

    I can't just put

    Code:
    <%
    LastPage = 15
    %>
    It would be . . . .

    Code:
    <%
    LastPage = RequestRecords + strRecordPerPage 'This would return the number
    %>
    Thanks

  3. #3
    SitePoint Enthusiast AlexHedley's Avatar
    Join Date
    Dec 2010
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried

    offset = Cint(offset)

    Al

  4. #4
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AlexHedley View Post
    Have you tried

    offset = Cint(offset)

    Al
    Some times ist better to write cInit("0" & offset)
    The result is 0 if offset has the value "" at else you have error message.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •