Stop my window from jumping

R

Randel Bjorkquist

How do I stop my WebForm from jumping back up to the top of the window every
time it's posted? What is happening is that I have a web-application that
has a couple of ListBoxes that I allow the end-user to fill in. They are
asked to fill in a TextBox which I then add to the ListBox. But after the
Button is clicked and I add the new text to the ListBox, the WebForm reloads
and positions itself back at the top.



I was thinking of putting anchor for each section and on a repost go to the
anchor by the Button. But unfortunately, I'm very new to all of this,
web-applications, the IDE for Visual Studio 2003 .NET, etc... If anyone has
some pointers, I'd greatly appreciate it.



Thanks,



Randel Bjorkquist
 
B

Brock Allen

In v1.x you can either use SmartNavigation or code a bunch of javascript
yourself to call window.setScrollPos when the document reloads after the
postback. In v2.0 this is a built in feature.
 
R

Randel Bjorkquist

Brock,

Thanks for the information. Unfortunately, I'm not following well enough.
Like I said in my first post, I have done an extremely small amount of web
programming. I really do not know HTML, DHTML, ASP (any version), etc... As
for creating a web-application, I'm just Visual Studio 2003 .NET in which
I've only has one semester of C#.

But with that being said, I do thank you for your information and will
continue to look at it as I develop more applications like this.

Randel
 
B

Brock Allen

So I'd suggest SmartNavigation then. Open your ASPX and add SmartNavigation=true:

<%@ Page SmartNavigation=true ..... %>

And see if that helps.
 
R

Randel Bjorkquist

Hey Brock,

That did the trick and is doing exactally what I want it to.

Thanks,

Randel Bjorkquist
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top