Trying to Create Image Gallery
Hi and thanks for taking a moment. I am trying to create an image gallery within a masterpage. My first page, called momsgallery.aspx has a series of thumbnail images that when clicked directs the user to a new page ( called momimage.aspx) and it passes a querystring value. The momimage.aspx shows the full image and at that time the address contains the querystring passed. (ex momimage.aspx?id=6)
I am using a Gridview on the momimage.aspx with an imagefield inside it. The Gridview uses an SQLDatasource to retrieve the image path and displays the image. Simple enough...see below.
Now I want to give the user the ability to navigate to the next image without returning to the momsgallery.aspx page. What I need to do is find some way to increment the querystring value so the page reloads and displays the next image. Is there a good/simple way to do this? I know I can do this sort of idea with photoshop by having it crank out a gallery, but that would mean I have to ditch my masterpage model. Any advice or help on how to create a hyperlink or button to do this would be greatly appreciated.
Jason
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="momimage.aspx.cs" Inherits="momimage" Title="Untitled Page" %>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server">
<table align="center">
<tr>
<td>
<asp:GridView ID="grdJaneImages" DataSourceID="SqlDataSource41" runat="Server" BorderWidth="0" AutoGenerateColumns="False">
<Columns>
<asp:ImageField DataImageUrlField="path" ShowHeader="False" ItemStyle-HorizontalAlign="Center" >
</asp:ImageField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td><asp:HyperLink runat=server NavigateUrl="~/momimage.aspx?id=@id+1">click here</asp:HyperLink></td>
</tr>
</table>
<asp:SqlDataSource ID="SqlDataSource41" runat="server" ConnectionString="<%$ ConnectionStrings:BeatlesConnectionString %>"
SelectCommand="SELECT [path] FROM [janeimages] WHERE ([id] = @id)">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="0" Name="id" QueryStringField="id" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
|