|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Scroll position in panel controlI've checked the posts but this question doesn't seem to have been asked in a while and I don't seem to be able to find an answer for it anywhere else. I have a panel control on my page that contains a datalist. The datalist renders small thumbnails (200px X 200px) for up to 200 images. When I click the image a itemSeleted event is fired, and a postback to the server renders a large copy of the image in an image control on the form. Unfortunately, due to the postback the panel control return to the top of its scroll position where I might not be able to see the thumbnail that I just selected. Does anyone know if I can maintain the scroll position of the panel control, just as I can with the form as a whole using the Page directive MaintainScrollPositionOnPostback? Can I get the scroll value of the panel control, or should I really look at javascript to load the image from the thumbnail and avoid the postback altogether? Any thoughs would be most welcome. Regards, Jason. *** Sent via Developersdex http://www.developersdex.com *** In ASP.NET 1.x, if you enable SmartNavigation on the page, it should be able
to retain the scroll position after postback. Here's more info: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIPageClassSmartNavigationTopic.asp If you're using ASP.NET 2.0, there is a (usually) better alternative: Page.MaintainScrollPositionOnPostBack = True Here's more info: http://msdn2.microsoft.com/en-us/library/system.web.ui.page.maintainscrollpositiononpostback.aspx Show quoteHide quote "Jason James" <jason.mapson@dive--master_nospam.org> wrote in message news:eDv3WWQUGHA.5468@TK2MSFTNGP14.phx.gbl... > Hi all, > > I've checked the posts but this question doesn't > seem to have been asked in a while and I don't > seem to be able to find an answer for it anywhere > else. > > I have a panel control on my page that contains > a datalist. The datalist renders small thumbnails > (200px X 200px) for up to 200 images. When > I click the image a itemSeleted event is > fired, and a postback to the server renders > a large copy of the image in an image control > on the form. Unfortunately, due to the postback > the panel control return to the top of its scroll > position where I might not be able to see the > thumbnail that I just selected. > > Does anyone know if I can maintain the scroll > position of the panel control, just as I can > with the form as a whole using the Page > directive MaintainScrollPositionOnPostback? > > Can I get the scroll value of the panel control, > or should I really look at javascript to load the > image from the thumbnail and avoid the > postback altogether? > > Any thoughs would be most welcome. > > Regards, > > Jason. > > > > *** Sent via Developersdex http://www.developersdex.com ***
Trouble with validator control ? Script not found
ObjectDataSource, GridView and ItemTemplate Is there a free .GIF software? Trouble with validator control ? script not found Display data in asp:Calendar ASP.NET 2.0 DataView DetailsView ImageField displaying images from Filtering the Asp:FileUpload control Asp.Net 2.0 Bug Adding AutoPostBack to a webcontrol Changing RadioButton's NAme and ID properties using vb.net |
|||||||||||||||||||||||