|
-
Aug 24th, 2004, 10:11 AM
#1
Thread Starter
Member
Dataset, repeater for picture gallery ?
How would you use a repeater within a dataset? I'm trying to display pictures, while only displaying 25 pictures per page. I want to be able to enable paging. How would I do this?
It's not the size of the dog in the fight, it's the size of the fight in the dog.
-
Aug 26th, 2004, 06:31 AM
#2
I wonder how many charact
Use a Datalist instead...
you can set the columns across through a property.
You can then go a google search for 'DataList paging', you'll get good articles like http://www.dotnetjunkies.com/Tutoria...2516BF05B.dcik
I mention using DataList because it passes the html validation, whereas Repeaters usually don't.
-
Aug 30th, 2004, 10:17 AM
#3
Frenzied Member
Use a datagrid.
Bind to query like this
Code:
(
@PageSize int,
@PageIndex int
)
AS
CREATE TABLE #TempTable
(
ImageRowID int IDENTITY(1,1),
ImageKey char(36)
)
INSERT INTO #TempTable (ImageKey)
SELECT Guid FROM Images
SELECT #TempTable.ImageRowID, Images.*
FROM #TempTable
INNER JOIN Images ON
Images.Guid = #TempTable.ImageKey
WHERE ImageRowID > @PageSize * @PageIndex
AND ImageRowID <= @PageSize * (@PageIndex+1)
ORDER BY #TempTable.ImageRowID
RETURN
turn off the detect colums and make it bind to the row and the image name or something. In the On/ItemDataBind event replace the text for column 2 (index 1) clear the text and add an img control with src set to you image load page or the real url if your pics or not in the db
If that doesn't make since let me know I just woke up
Magiaus
If I helped give me some points.
-
Jan 4th, 2009, 07:54 PM
#4
Frenzied Member
Re: Dataset, repeater for picture gallery ?
Hi!
I want to add on this question. What if I want to create a simple repeater that renders a table x times y cells filled with images like a photo gallery. I get the image using an ashx http module. How would this be possible?
I have thought about the idea about creating the itemtemplate with 3 or 4 images, but then I always get the table 3 or 4 cells wide. What if the last image is on cell 1 (from the left). Then I must detect this somehow and remove the images, so they don't show the ugly red cross.
Anyone has any ideas? I did a google and found very little regarding this. I thought it was a very common problem...
kind regards
Henrik
-
Jan 5th, 2009, 05:19 AM
#5
Frenzied Member
Re: Dataset, repeater for picture gallery ?
Forget my question.... dah, I will just use a DataList control.
cheers/Henrik
-
Jan 5th, 2009, 10:02 AM
#6
Re: Dataset, repeater for picture gallery ?
DataList is best for this purpose. If you have the ListView, that's the same but slightly better and meant for galleries or a dynamic number of cells rather than rows.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|