ASP calling same page on Index selection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Anderson

    ASP calling same page on Index selection

    Hi All.

    I have an ASP page that has over 150 records listed. I would like to
    have an "Index" (A,B,C,D...) at the very top of the page.
    Once a letter is clicked, I need to:
    1) Call a SQL string like "SELECT * from WoD Where UCASE(WotD) LIKE "
    & UCASE(strSelect ed) & "*" & Chr(34)

    2) Recall the SAME page (Not another ASP page) withpopulating with the
    new recordset.

    I am having a total brain fart on this and can't figure it out.
    Any help would be appreciated.

    TIA
  • Roland Hall

    #2
    Re: ASP calling same page on Index selection

    "Chris Anderson" wrote:
    : Hi All.
    :
    : I have an ASP page that has over 150 records listed. I would like to
    : have an "Index" (A,B,C,D...) at the very top of the page.
    : Once a letter is clicked, I need to:
    : 1) Call a SQL string like "SELECT * from WoD Where UCASE(WotD) LIKE "
    : & UCASE(strSelect ed) & "*" & Chr(34)
    :
    : 2) Recall the SAME page (Not another ASP page) withpopulating with the
    : new recordset.

    Something like this?




    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp


    Comment

    • Chris Anderson

      #3
      Re: ASP calling same page on Index selection

      On Sun, 15 Feb 2004 05:02:07 -0600, "Roland Hall" <nobody@nowhere >
      wrote:
      [color=blue]
      >"Chris Anderson" wrote:
      >: Hi All.
      >:
      >: I have an ASP page that has over 150 records listed. I would like to
      >: have an "Index" (A,B,C,D...) at the very top of the page.
      >: Once a letter is clicked, I need to:
      >: 1) Call a SQL string like "SELECT * from WoD Where UCASE(WotD) LIKE "
      >: & UCASE(strSelect ed) & "*" & Chr(34)
      >:
      >: 2) Recall the SAME page (Not another ASP page) withpopulating with the
      >: new recordset.
      >
      >Something like this?
      >
      >http://kiddanger.com/lab/spandex.asp[/color]

      This would be the index part, yes.
      Although this appears to be Javascript and I am using vbscript.

      But how whould I call the same page back with the new SQL statement?

      Thanks.

      Comment

      • Roland Hall

        #4
        Re: ASP calling same page on Index selection

        "Chris Anderson" wrote:
        : On Sun, 15 Feb 2004 05:02:07 -0600, "Roland Hall" <nobody@nowhere >
        : wrote:
        :
        : >"Chris Anderson" wrote:
        : >: Hi All.
        : >:
        : >: I have an ASP page that has over 150 records listed. I would like to
        : >: have an "Index" (A,B,C,D...) at the very top of the page.
        : >: Once a letter is clicked, I need to:
        : >: 1) Call a SQL string like "SELECT * from WoD Where UCASE(WotD) LIKE "
        : >: & UCASE(strSelect ed) & "*" & Chr(34)
        : >:
        : >: 2) Recall the SAME page (Not another ASP page) withpopulating with the
        : >: new recordset.
        : >
        : >Something like this?
        : >
        : >http://kiddanger.com/lab/spandex.asp
        :
        : This would be the index part, yes.
        : Although this appears to be Javascript and I am using vbscript.
        :
        : But how whould I call the same page back with the new SQL statement?

        This is VBScript on the server side and DHTML on the client side. VBScript
        doesn't support events. If you're using IE, which is the only browser that
        supports VBScript on the client side, then this will work just fine.

        This is the server side:

        if Request.QuerySt ring("ndx") <> "" Then
        Response.Write( "<div id=""ndx"">You chose " & Request.QuerySt ring("ndx") &
        "</div>")
        end if

        The client side passes the index on the URL. The server side grabs it when
        it reloads the page. Now that you have the index identified, you write your
        server side code to make a connection to the server, grab the relevant data
        by passing your SQL statement and then output the contents.

        I wrote CSS to position the Index 5px down, 5px across. I positioned my
        example to show the result below that. You would position your content in a
        similar fashion. I suggest making a call to the server, grab the data with
        rs.getrows(), create your loop, and in it, output your data.

        <%
        dim r, iCols, iRows, nCols, nRows, rThis

        ' make connection to db
        ' execute SQL statement and retrieve data in rs.getrows()

        r = rs.getrows()
        conn.close
        set conn = nothing
        set rs = nothing

        ' write FOR...NEXT loops and display data

        nCols = ubound(r,1) ' number of columns
        nRows = ubound(r,2) ' number of rows

        for iRows = 0 to nRows
        Response.Write( "<div class=""divRows "">)
        for iCols = 0 to nCols
        rThis = r(iCols, iRows)
        Response.Write( "<span>" & rThis & "</span>")
        next
        Response.Write( "</div")
        next
        %>

        I just jotted this down here so it is untested. The divRows class should
        not have CSS positioning information. Put it in a container that has
        positioning so you know where to start.

        HTH...


        Comment

        • Chris Anderson

          #5
          Re: ASP calling same page on Index selection

          On Sun, 15 Feb 2004 16:54:35 -0600, "Roland Hall" <nobody@nowhere >
          wrote:
          [color=blue]
          >
          >This is VBScript on the server side and DHTML on the client side. VBScript
          >doesn't support events. If you're using IE, which is the only browser that
          >supports VBScript on the client side, then this will work just fine.
          >
          >This is the server side:
          >
          >if Request.QuerySt ring("ndx") <> "" Then
          > Response.Write( "<div id=""ndx"">You chose " & Request.QuerySt ring("ndx") &
          >"</div>")
          >end if
          >
          >The client side passes the index on the URL. The server side grabs it when
          >it reloads the page. Now that you have the index identified, you write your
          >server side code to make a connection to the server, grab the relevant data
          >by passing your SQL statement and then output the contents.
          >
          >I wrote CSS to position the Index 5px down, 5px across. I positioned my
          >example to show the result below that. You would position your content in a
          >similar fashion. I suggest making a call to the server, grab the data with
          >rs.getrows() , create your loop, and in it, output your data.
          >
          ><%
          >dim r, iCols, iRows, nCols, nRows, rThis
          >
          >' make connection to db
          >' execute SQL statement and retrieve data in rs.getrows()
          >
          >r = rs.getrows()
          >conn.close
          >set conn = nothing
          >set rs = nothing
          >
          >' write FOR...NEXT loops and display data
          >
          >nCols = ubound(r,1) ' number of columns
          >nRows = ubound(r,2) ' number of rows
          >
          >for iRows = 0 to nRows
          > Response.Write( "<div class=""divRows "">)
          > for iCols = 0 to nCols
          > rThis = r(iCols, iRows)
          > Response.Write( "<span>" & rThis & "</span>")
          > next
          > Response.Write( "</div")
          >next
          >%>
          >
          >I just jotted this down here so it is untested. The divRows class should
          >not have CSS positioning information. Put it in a container that has
          >positioning so you know where to start.
          >
          >HTH...
          >[/color]

          Yep. Just saw that. The bad past is that at least 1/2 of the ppl
          hitting this site will use Mozilla or Netscape.
          I need an all browser solutioin. Hm...

          Comment

          • Roland Hall

            #6
            Re: ASP calling same page on Index selection

            "Chris Anderson" wrote:
            : Yep. Just saw that. The bad past is that at least 1/2 of the ppl
            : hitting this site will use Mozilla or Netscape.
            : I need an all browser solutioin. Hm...

            Chris...

            Server-side works with any browser so it is ok to use VBScript there. I'm
            using DHTML on the client-side, not VBScript, so this IS an all browser
            solution or more of one than VBScript, as you requested. I apologize if
            that was not clear in my earlier post.

            HTH...

            --
            Roland Hall
            /* This information is distributed in the hope that it will be useful, but
            without any warranty; without even the implied warranty of merchantability
            or fitness for a particular purpose. */
            Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
            WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
            MSDN Library - http://msdn.microsoft.com/library/default.asp


            Comment

            Working...