Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I have a problem when I want run my web page and select item in page that get data from in update panel, the page jump at the first of page.

It's not good, can you tell me how can I solve page jumping in my web?

Thanks
Posted
Updated 30-Jul-12 9:46am
v2
Comments
Sergey Alexandrovich Kryukov 30-Jul-12 15:46pm    
If this is "not good" for you, you should explain what would be good, exactly, before asking "how".
--SA
Nueman 30-Jul-12 15:48pm    
Tried to make the question as readable as I could given English apparently not first language.
veusk 30-Jul-12 16:10pm    
for example I have a page for reistration of users and they should fill this form, like name ,family and so on BUT at the middle page they should select date by click a button for showing the calender when click on this button the page jump at the first page
while I want stay at last location(button)
Sergey Alexandrovich Kryukov 30-Jul-12 22:17pm    
Please listen: knowing English as a non-native language is not a sufficient excuse to write this way. After all, everyone can use a spellchecker, or use a Web browser with an embedded spellchecker. What is "reistration", "calender"?! And you should not write " ,", ignore spacing and capitalization. This is a matter of simple politeness, not language knowledge.
--SA

You can solve this problem by using these solutions:-

1.By Setting the MaintainScrollPositionOnPostBack property of Page to true.
C#
Page.MaintainScrollPositionOnPostBack = true;


2.By Using SetFocus method of Page.
C#
Page.SetFocus(your_controlID);
//this method needs to provide your Control's Id which you want to focus.


3.By JavaScript function.
JavaScript
window.scrollTo = function (x, y) {
         return true;
     }


I hope it will help you.
Best of luck.
 
Share this answer
 
Comments
_Amy 31-Jul-12 1:01am    
+5 for first option. :)
As Rajesh told maintain the scroll position.
Set the MaintainScrollPositionOnPostback="true" in your page directive.
Try this:
ASP.NET
<%@ Page Title="" Language="C#" Trace="false" MasterPageFile="~/Main.master" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeFile="eUW_Fire_RegisterQuote.aspx.cs" Inherits="Fire_RegisterQuote" %>


--Amit
 
Share this answer
 
v2
Comments
veusk 31-Jul-12 14:46pm    
thanks but not solved

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