473,216 Members | 1,321 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

paging folders

The code bellow will display a list of folders in a directory. Now lets
say I have 20 folders, I want to display the first 10 folders, then
display another 10 folders just like the paging concept how is it done?
<table cellpadding="3" cellspacing="0" border="0" width="420">
<tr>
<td width="120"> </td>
<td width="300">

<%
Set objFSO =
Server.CreateObject("Scripting.FileSystemObject")

If objFSO.FolderExists(myFolderPath) Then
'The main picture folder exists
Set objPicturesFolder = objFSO.GetFolder(myFolderPath)
Set collPicturesFolders = objPicturesFolder.SubFolders
For Each indPicturesFolder in collPicturesFolders
indPicturesFolderSpaces =
Replace(indPicturesFolder.Name,"_"," ")
%>
<img src="icons/orangeball.gif" align="top">
<a href="thumb.asp?Folder=<%= indPicturesFolder.Name
%>" class="links">
<%= indPicturesFolderSpaces %></A>
<%
Next
%>
<%

Set collPicturesFolders = Nothing

Else
'The main picture folder does not exists
%>
<font class="error">No Pictures could be
found.</font>
<%
End If
%>
</td>
</tr>
</table>
Your help is kindly appreciated.
Eugene Anthony

*** Sent via Developersdex http://www.developersdex.com ***
May 24 '06 #1
4 1468
Eugene Anthony wrote on 24 mei 2006 in
microsoft.public.inetserver.asp.general:
The code bellow will display a list of folders in a directory. Now lets
say I have 20 folders, I want to display the first 10 folders, then
display another 10 folders just like the paging concept how is it done?


Just count them:

page = 3
' starting at page 0 and each page has 10 files, but for the last page
n=0
For Each indPicturesFolder in collPicturesFolders
if n>=page*10 and n<=page*10+9 then
response.write indPicturesFolder.Name & "<br>"
end if
n=n+1
next

This is basic vbs, but untested
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 24 '06 #2
Is there a way to store the names into a session variable, then using
the variable apply the paging style (next, previous).

Eugene Anthony

*** Sent via Developersdex http://www.developersdex.com ***
May 24 '06 #3
Eugene Anthony wrote on 24 mei 2006 in
microsoft.public.inetserver.asp.general:
Is there a way to store the names into a session variable, then using
the variable apply the paging style (next, previous).


What are you talking about?

Please quote what you are replying to. If you want to post a followup via
groups.google.com, don't use the "Reply" link at the bottom of the article.
Click on "show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
<http://www.safalra.com/special/googlegroupsreply/>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 24 '06 #4

"Eugene Anthony" <so***********@yahoo.com> wrote in message
news:uS**************@TK2MSFTNGP05.phx.gbl...
Is there a way to store the names into a session variable, then using
the variable apply the paging style (next, previous).

There is but I'm not sure that level of complexity is required for just 20
folders. However assuming you have a lot more in a real world situation and
after some performance testing you can see that all the FSO activity would
cause the app a problem, then as an outline this is what I would do:-

Create function which builds an XML representation of the folders into a
Free Threaded DOM. Store the DOM in the Session object. Have page accept a
startIndex and itemCount query string values to specify the items needed.
The output can then access the appropriate items using syntax like this:-

If lItemCount + lStartndex > xmlDOM.documentElement.childNodes.length Then
lItemCount = xmlDOM.documentElement.childNodes.length - lStartIndex
End If

For i = lStartIndex To lStartIndex + lItemCount - 1
Set elem = xmlDOM.documentElement.childNodes(i)
' Write HTML to Response
Next

This should preform reasonably well. You could consider storing the XML in
the application object if the list is quite static and is useful to multiple
users. However in both cases you might also need to mechanism to drop them
from the application or session object when not needed.

Eugene Anthony

*** Sent via Developersdex http://www.developersdex.com ***

May 29 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
2
by: RelaxoRy | last post by:
sqlConnection1.Open(); myReader = sqlCommand1.ExecuteReader(); DataGrid1.DataSource = myReader; DataGrid1.DataBind(); myReader.Close(); sqlConnection1.Close(); The Datagrid populates fine. ...
6
by: Shawn | last post by:
Hi. I already have a datagrid where I'm using paging. I have a stored procedure that fills a temp table with 200-500 rows and then sends back 10 records at the time. When I go to page 2 the SP...
2
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
2
by: farhad13841384 | last post by:
Hi , I Hope You fine. I have some problem with this code for paging in asp.net this bottom code work correctly without any error but when I try to place separate code in .VB file then error is...
0
by: anonieko | last post by:
This approach I found very efficient and FAST when compared to the rowcount, or Subquery Approaches. This is before the advent of a ranking function from DB such as ROW_NUMBER() in SQL Server...
2
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
3
by: Ronald S. Cook | last post by:
I was told that if calling lots of records from the database (let's say 100,000), that the GridView's paging feature would automatically "handle" everything. But the 100,000 records are still...
5
by: Donald Adams | last post by:
Hi, I will have both web and win clients and would like to page my data. I could not find out how the datagrid control does it's paging though I did find some sample code that says they do it...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.