0

My page contains datalist that renders small thumbnails of 90 x 70. When i click on thumbnail a large copy of thumbnail in an image control above the datalist is displayed.The problem is page goes to top of its scroll position.I have to scorll down to get to thumbnail.How can i maintain scrolling position of my page?

<asp:Image ID="imgCarPhoto" runat="server" Height="300px" Width="385px" />&nbsp;<asp:DataList ID="dlstCarPhotos" runat="server" RepeatDirection="Horizontal" RepeatColumns="4">
					<ItemTemplate>
						<a href="#" runat="server" id="lnkPreviewImage">
							<asp:Image ID="imgCar" runat="server" ImageUrl='<%#Eval("PictureID","UserControls/imageByPID.ashx?pid={0}")%>'
								Width="90" Height="70" AlternateText="" />
						</a>
					</ItemTemplate>
				</asp:DataList>
2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by fawadkhalil
0

i use following code to prevent page from postback.

Protected Sub dlstCarPhotos_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dlstCarPhotos.ItemDataBound
        Try
            CType(e.Item.FindControl("lnkPreviewImage"), HtmlAnchor).Attributes.Add("onClick", "javascript:document.getElementById('" & imgCarPhoto.ClientID & "').src = '" & CType(e.Item.FindControl("imgCar"), System.Web.UI.WebControls.Image).ImageUrl.ToString & "'; ")

        Catch ex As Exception
            lblerror.Text = ex.Message
       End Try
	End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.