473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Unwanted Refresh/Redraw

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. The
problem 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,
Nov 18 '05 #1
2 2257
When you click on a button, that is the default behavior.You can stop the
postback with client side javascript if you don't want it to post back - but
typically people want it to post to the server to do some work.

There is not much you can do about the redrawing - the page posts to the
server, and then sends down a brand new page, which has to be downloaded and
drawn. This is the nature of web programming.

You can try turning on smart navigation on your page. That should fix the
scrolling issue. However, smart navigation is known to be buggy and can
sometimes cause problems, so be careful.

"Kevin Chandler" <Ke************@DaytonRCSNoSpamHere.com> wrote in message
news:i3***************@news.abs.net...
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. The problem 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,

Nov 18 '05 #2

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,


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: marco | last post by:
Juste a simple question about the DC in wxpython ... I've made a wxWindow class, where i need to paint myself the content. so i've added an evt_paint() to draw in the wxPaintDC ... It works like...
0
by: AK | last post by:
Hi, I have a medium sized app that I'm transferring to use curses. What happens is very very strange.. I am at my wits' ends. I worked with it all day yesterday and couldn't figure it out....
1
by: kiplring | last post by:
I wrote a program which draw a dancer at cornor of desktop. ( I Accessed through hDC) But It has a problem. I remains all trait at the desktop until I invoke any Redraw( Refresh) action - click,...
1
by: IkBenHet | last post by:
Hello, Currently I am using a large input form on a website that is based on ASP and JavaScript. Depending on the values that are filled in by the user the forms does a refresh and makes...
17
by: SamSpade | last post by:
picDocument is a picturebox When I do picDocument.Invalidate() the box paints. But if instead I do picDocument.Refresh() the box does not paint. What does Refresh do. I guessed it did an...
1
by: Christopher Shanahan | last post by:
Hello, I've built a data entry form for a survey database that appears to make the entire form flicker when I mouse over anyn of the label controls. I suspect that it has to do with the...
3
by: kingflux | last post by:
Hello, and thank you in advance for any help you can provide. Each line in our datagrid control contains a product number, description, and a textbox for the user to enter a quantity-to-order. ...
3
by: R.A.F. | last post by:
Hi, I have a custom control in which i have a property based on CollectionBase class. like the following one : //------- XGrid.cs file --------------// public ColumnsCollection Columns {
5
by: tshad | last post by:
I have an interface I am using to get access to some of the objects on my form: a textbox (Status) and my statusbar (StatusBar). In my class, which is actually in another class from my form I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.