Adding Table Cells and Images/Links (ASP.NET Controls) Dynamically


Carl Gilbert


I am working on a site using ASP.NET, VB.NET and SQL Server. I have a page
that displays images, and I want to display additional links to other images
within the same category.

When the page loads I know how many pages are in the current category and
the current page (set of images to display). The images are displayed in
groups of 8 but a category may have more than 8 images. To provide a way to
view other images in the category, I would like to place links at the bottom
of the page.

I will know how many pages I have in the category by dividing by 8 and
rounding up.

The following link shows a screenshot of how the page might look with a
category of 48 images. It shows that we are on page 1 and there are 5 other
pages available.

I would therefore like to ask if anyone knows how to dynamically add these
links in the page load event.

The dividers are 1px wide so I was thinking of just using a load of <TD>'s
setting the dividers to 1px wide with a background color and then using
<ASP:HYPERLINK>'s for the numbers so I can dynamically set their target
URL's unless anyone has any better ideas.

So really I think it could just a case of inserting HTML from the code
behind file. If so, how can this be done?

Regards, Carl Gilbert