I am basically making a website for my university project which is basically a photography&wallpapers site I have saved images in folder(named as ImageStorage) and I am retrieving images through Image link from database I have used datalist in my page(image-viewer.aspx) to show my all images as imagebutton. What I basically want is that when user clicks on an image it redirects to another page(image-detail.aspx)and also sends the url or id of that image so that I can use it to display that image on (image-detail.aspx) page
Here is my image_viewer.aspx code:
<form id="form1" runat="server">
<div>
<asp:DataList ID="DataList1" runat="server" CellPadding="15" CellSpacing="10" DataSourceID="SqlDataSource1" GridLines="Both" OnSelectedIndexChanged="DataList1_SelectedIndexChanged" RepeatColumns="3" RepeatDirection="Horizontal" style="margin-left: 0px" >
<ItemTemplate>
<br />
<asp:ImageButton ID="Image1" style="width:335px ;height:210px" runat="server" ImageUrl='<%# Eval("ImagePath") %>' CommandName="imgClick"/>
</ItemTemplate>
</asp:DataList>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:photo_stock_viewConnectionString %>" SelectCommand="SELECT * FROM [ImageInfo1]"></asp:SqlDataSource>
<br />
</div>
</form>
HTML code in image_detail.aspx to show image:
<img class="img-fluid mt-4" src="ImageStorage/image-detail.jpg"/>