?
Solved

Nested Repeaters

Posted on 2004-12-01
4
Medium Priority
?
586 Views
Last Modified: 2012-05-05
Hi,

       I want to show a series of images in two dimensions. For that I want to use nested Repeaters, but with the SAME DATASOURCE. Also I want to show 4 images in a row and then it should wrap up to the second row and after 5 such rows, on to the next page.

       I Googled about this. I came across some example of nested repeaters but they had Different Datasources for both repeaters. They were bound with a primary key from one table as foreign key in another table. But I want SAME DATASOURCE in both repeaters...The page will look like something below with images in empty squares.

                |         |      |
       -------|-------|-----|-----
                |        |       |
       -------|-------|-----|-----
                |        |       |
       -------|-------|-----|-----
                |        |       |
 
      Is there a way of doing this? Has anybody dome something like this or know some pointer where I can look?

     Thanks,
    -Payal
0
Comment
Question by:payal1711
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
gbelken99 earned 500 total points
ID: 12721340
are you going to be getting this info from a database?  If so I think the easiest way would be to use a datalist control instead.  With the datalist you can easily set the number of columns to repeat before going to the next row.  You can create the paging functionallity pretty easily with SQL.
0
 
LVL 1

Author Comment

by:payal1711
ID: 12721367

   Yes, I will be getting data from the database. How can I create the paging functionality with SQL, can you give an example?
0
 
LVL 3

Assisted Solution

by:gbelken99
gbelken99 earned 500 total points
ID: 12721440
sure what you would do is the following Select top YourPageSize * from yourtable where data = this and yourtablesprimarykey no in (Select top RowstoSkip yourtablesprimarykey  from yourtable)

so say you had a table that looked like this
TableName: images
id  --- autonumber
imglink --- varchar
group -- varchar

and you only want to show 20 pictures per page you would write the SQL like this


this would be page 1
Select top 20 * from images where group='students' and id not in (Select top 0 id from images)


this would be page 2
Select top 20 * from images where group='students' and id not in (Select top 20 id from images)

etc etc.  Hope you understand that.
0
 
LVL 1

Author Comment

by:payal1711
ID: 12721476

  Of course I understood..you made it so easy...I also found a link you would like to see. It is about adding paging to DataList Control. I dont know if it works, but if it doesnt, I can always use the sql method you just specified..

    http://www.dotnetbips.com/displayarticle.aspx?id=115

     Thanks a lot for your prompt help.
   -Payal
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

839 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