Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have one large page.in middle of the page i do some actions like add ,update .now add or update using button click that time records is updated but the page is refresh and goto top of the page how to fix it.

What I have tried:

OnClientClick="return false;"

But this is block codebehind.and use some methods but not works.
Posted
Updated 17-May-17 4:30am
v2
Comments
Bhola Ram Sahu 17-May-17 8:16am    
You should use UpdatePanel
F-ES Sitecore 17-May-17 9:41am    
See if "MaintainScrollPositionOnPostback" will fix this for you (it's usually added to the Page directive at the top, google for specific implementation examples)

1 solution

If you do not want to have the page go back to the top after a refresh then use the setting F-ES Sitecore mentions in comments.
MaintainScrollPositionOnPostback


If you do not want the postback you need to re-write your code to use Ajax calls using jQuery or something similar.

Or, you can do as Bhola mentions in the comments, put your controls into an UpdatePanel so that the postback is not as noticeable to the user.
 
Share this answer
 
Comments
Raja Ganapathy 18-May-17 3:26am    
Thank you Working fine

<%@PageMaintainScrollPositionOnPostback="true"%>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900