Forums
This topic is locked
Dataset Navigation Not Working
Posted 03 Sep 2007 11:19:13
1
has voted
03 Sep 2007 11:19:13 Mark McElhone posted:
Hi, On a page I have a job description and then there will be images to show for this job - I have an image being drawn in from a database using
<ASP:Repeater runat="server" DataSource='<%# job_images.DefaultView %>'>
<ItemTemplate><img src="images/<%# job_images.FieldValue("image_name", Container) %>" width="461"></ItemTemplate>
</ASP:Repeater>
where job_images is the database table name and image_name is the image. Now, this image comes through with no problems at all. This image will be the first of four, each job has at least four images. So, I want to have buttons for next and previous. Unfortunately these buttons dont work. The code for them is:
</a><a href="<%# Request.ServerVariables("SCRIPT_NAME" %>?job_images_currentPage=<%# Math.Max(job_images.CurrentPage - 1, 0) %>&ID=<%# job_images.FieldValue("ID", Container) %>"><img src="images/gallery/butt_previous.gif" alt="previous image" width="20" height="20" border="0"> <a href="<%# Request.ServerVariables("SCRIPT_NAME" %>?job_images_currentPage=<%# job_images.LastPage %>&ID=<%# job_images.FieldValue("ID", Container) %>">
</a><a href="<%# Request.ServerVariables("SCRIPT_NAME" %>?job_images_currentPage=<%# Math.Min(job_images.CurrentPage + 1, job_images.LastPage) %>&ID=<%# job_images.FieldValue("ID", Container) %>"><img src="images/gallery/butt_next.gif" alt="next image" width="20" height="20" border="0"></a></td>
Unfortunately, when i click on the next button it doenst go to the next id for a certain job but a random picture from another job.
Any ideas?
I have also tried just putting in dataset navigation from Dreamweaver toolbar but wont work either.