Another way to do this is to cheat a bit... You can use javascript in
the <body> tag's "onload" attribute. This attribute can be used to tell a
browser to seek an anchor on your page.
So, the idea is to place anchor tags next to each of your asp:button(s).
"<a name='buttonX' />" Or at least space anchors out on your webpage,
and label them descriptively.
Your asp logic can modidy the <body> element's onload attribute to force
the browser to navigate to a specific anchor tag immediately on page load.
For example, if someone clicked asp:button #2, you should have already
placed an anchor in the page near that button, like <a name='button2' />
When you 'build' the page on the server, make sure you insert the "onload"
attribute to the <body> tag. This would look something like
<body onload="javascript
:window.location='#button2'">
That's probably not quite the right syntax, but you can search online for
good examples on javascript sites.
-Charlie
--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).
--------------------
From: "Kevin Chandler" <Ke************@DaytonRCSNoSpamHere.com>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Unwanted Refresh/Redraw
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <i3***************@news.abs.net>
Date: Thu, 29 Jan 2004 10:56:55 -0500
NNTP-Posting-Host: 206.21.112.114
X-Complaints-To: su*****@coax.net
X-Trace: news.abs.net 1075391822 206.21.112.114 (Thu, 29 Jan 2004 10:57:02
EST)NNTP-Posting-Date: Thu, 29 Jan 2004 10:57:02 EST
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!newsfeed00.su
l.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nn
tp.abs.net!news.abs.net!not-for-mailXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:206121
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
I appologize in advance if this is a novice question. I don't have much
ASP.Net experience.
I have an NCAA tournment selection page that I use asp:button controls.
Theproblem is that everytime I click one of the buttons, the entire page
redraws and the screen is scrolled to the top. How can I stop the entire
screen from refreshing or how can I stop the page from scrolling back up to
the top?
Thanks in advance for your help,