Click to See Complete Forum and Search --> : [RESOLVED] keeping the page in position during postback


JonnyPoet
December 17th, 2008, 02:54 PM
Hi Friends !
As I'm fairly new in any web programming I have some realy basic questions. So here is one. How to get a aspx page in position during postback.

Th eproblem is easy. My page is longer then one page of a screen so people scroll down while filling out a questionary. When they are at the end they have to click a button and to send the questionary. The postback delivera a Captcha which is to answer before the programm áccepts the data. This all works but when they click on the button and the postback is sent the page reloads at the top of the page, so people again need to scroll down to see the captcha.Also when the Captcha is to complex and they want another one, they get it by clicking but the page reloads to the top instead to the last position it has had.

i have seen on other pages that this can be done but how to do this ?

TheCPUWizard
December 17th, 2008, 02:56 PM
You can manually do it, but it is complicated. Why not just use AJAX instread of full page postbacks? Much more interactive....

JonnyPoet
December 17th, 2008, 03:00 PM
You can manually do it, but it is complicated. Why not just use AJAX instread of full page postbacks? Much more interactive....Simple because I know really nothing about it :D

TheCPUWizard
December 17th, 2008, 03:03 PM
Simple because I know really nothing about it :D

It is well worth the time to go through the tutorials on MSDN. I have not used a full page postback for an ASP.NET application in over two years.

JonnyPoet
December 17th, 2008, 05:29 PM
It is well worth the time to go through the tutorials on MSDN. I have not used a full page postback for an ASP.NET application in over two years.Doesn't showing and drawing the captcha in any case need a full postback ?
And where do I find the tutorials or are you talking about AJAX Tutorials ?
( I just have learned to use javascrippt for all the radio buttons which I'm using in that formular so I only need two postbacks in the moment That one for sending the data and that one for the captcha test. )

TheCPUWizard
December 17th, 2008, 06:36 PM
I am referring to the AJAX tutorials. And, NO a full postback is almost NEVER required. Consider the amount of information on the page that will NOT change...

An UpdatePanel allows you to change just the DATA.

JonnyPoet
December 18th, 2008, 02:25 AM
I am referring to the AJAX tutorials. And, NO a full postback is almost NEVER required. Consider the amount of information on the page that will NOT change...

An UpdatePanel allows you to change just the DATA.I see. I started to see the ajax videos yesterday evening. Thx a lot

JonnyPoet
December 19th, 2008, 06:05 PM
Hi friends !

For all who also needed this. I found a very easy solution
Simple set on top position of your asp.net page the following

<%@ Page Language="C#" MaintainScrollPositionOnPostback="true" .... %>
The dots are your standard settings you have there. This really wrks nice. even for a full postback. BTTW: I'm using VS 2008