lamy Posted December 19, 2005 Posted December 19, 2005 i have a form which i validate on code behind, after postback the page is on its topmost, i wanted it to move to an anchor somewhere in my page, anyone knows how to do this, or is there an alternative to this? Quote slow down when you need to hurry, stop when you need to move on, look back when you need to forget, or you might slip and leave sanity
HJB417 Posted December 19, 2005 Posted December 19, 2005 This might help http://www.quirksmode.org/js/findpos.html Quote
lamy Posted December 27, 2005 Author Posted December 27, 2005 tnx HJB417, ill give it a try Quote slow down when you need to hurry, stop when you need to move on, look back when you need to forget, or you might slip and leave sanity
Diesel Posted December 27, 2005 Posted December 27, 2005 I think santa left a little hash in hb's stocking. I don't see what that web page has to do with the question. Anyway...if you don't need to save the viewstate of the page...you can simply name an anchor... <a href="#" name="myAnchor"></a> and do a Response.Redirect in the postback if (IsPostBack) { Response.Redirect("mypage.aspx#myAnchor"); } A better approach would be to use XmlHttpRequest, send the form data to the function that processes it, and then just move the page down to the anchor with some javascript. The page doesn't have to reload. Quote
HJB417 Posted December 28, 2005 Posted December 28, 2005 I was thinking something complex usign javascript to scroll the browser to the position of an element but using bookmarks is a simple and much more straightforward approach. Had I thought of it, I would have recommended it. Quote
lamy Posted January 11, 2006 Author Posted January 11, 2006 thanks guys, that ought to do it anyway this was just an optional function im trying to implement, i might stick to this for awhile <%@ Page Language="vb" MaintainScrollPositionOnPostBack="true" %> Quote slow down when you need to hurry, stop when you need to move on, look back when you need to forget, or you might slip and leave sanity
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.