Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Classic ASP newbie

Last post 07-08-2008 1:17 PM by Dangermouse99. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-20-2008 12:02 PM

    Classic ASP newbie

    Hi, I'm a total newbie to classic ASP as I'm a .NET developer and have recently started work with classic ASP. I would like to display a lot of information on one page, preferably through using tabs so the user can click between them. I have no idea how to do this in classic ASP, and this example I found was too advanced for me:

    http://www.developerfusion.co.uk/show/4403/6/

    Can anybody help / post some code if it can be done please?

    The simpler the better!

    Thanks

    Dan

    • Post Points: 10
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 07-07-2008 11:22 PM In reply to

    • HelpTechIT
    • Not Ranked
    • Joined on 05-02-2008
    • United Kingdom
    • New Member
    • Points 105

    Re: Classic ASP newbie

     

    Hi mate, i have tried to add this as a resourse but it doesnt appear in the listings. however, here is the way i do it. hope it helps.

     Dan

    Search Results indexing across multiple pages

    This code is really simple but you have to know how request.querystrings work.

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <%' you need to include your database mappath location%>
    <!--#Include file="cn.asp"-->

    <%
    'create a recordset object
    Set rItems = Server.CreateObject("ADODB.Recordset")

    'set the cursor location and type
    rItems.CursorLocation = 3' adUseClient
    rItems.CursorType = 3 'adOpenStatic

    'number of rows to cache at a time. Should be set to the same as PageSize
    rItems.CacheSize = 10

    'number of items to display per 'page'
    rItems.PageSize = 10

     dim rs
     dim cn
     
     set cn = Server.CreateObject("Adodb.Connection")
     cn.Open conn
     sqlstring = "Select * From staffnames" 'change this to suit your db
     rItems.open sqlstring, cn

    'check if empty
    If rItems.EOF Then
        'no rows
    Else

        'set current page
    if request.QueryString("page") <> "" then ' if page= nothing this you are on the first page without this if statement you would get an error like Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
        rItems.AbsolutePage = Request.QueryString("page")
    end if
        'get the total number of records
        nItemCount = rItems.RecordCount

        'get the number of pages
        nPageCount = rItems.PageCount

        'loop through an display the items in the recordset
        Do While Not rItems.EOF and nItem < rItems.PageSize
      'displays records
      response.write rItems.fields("Name")
      %><br /><%

            'do something
            rItems.MoveNext 'move to the next record
            nItem=nItem+1 'increment count

        Loop
    End If

    'close the recordset
    rItems.Close

    'and destroy the object...
    Set rItems = Nothing


    %>
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>


    <p>&nbsp;</p>
    <p>
    <%
    ' this loop works out the amount of pages needed and then writes them in html
    dim i
    i = 1
    for i =1 to nPageCount%>
    <a href="default2.asp?page=<%=i%>"><%=i%></a>
    <%
    next
    %>

    </p>
    </body>
    </html>

    if you need help let me know.

    Good luck!

     

    • Post Points: 10
  • 07-08-2008 1:17 PM In reply to

    Re: Classic ASP newbie

    Hi, thanks very much for that.

    I've finished that project now, using javascript for visibility of tabs.

    I'll keep the code you sent for when I next have to do something similar.

    Thanks

    Dan

    • Post Points: 5
Page 1 of 1 (3 items)