Refresh just part of the screen?

C

Conax

Hi there,

My boss is hoping that I can come up with a page that displays some
information. The information will always be displayed on specific part of
the page, with auto refresh. But he doesn't want the whole page to be
refreshed so that buttons and images around the information do not get
reloaded each time. Is this really possible?

Other pages on this site don't use frames, so this page can't use frams too.
Creating an ActiveX control is also not an option of us...

Any other ideas will be so much appreciated.

Thank you
Conax
 
A

Adrian Forbes [ASP MVP]

You could try an IFRAME which is a frame embeded in a page. Other than that
you're looking at some form of client script to get the new data to display
and updating it using DHTML. Or maybe use a client-control of some sort.
IFRAME is by far the simplest though.
 
M

Mark Schupp

Is the "don't use frames" a company policy?
Frames would be the simplest and most browser-neutral method. Otherwise see
the other responses and beware of browser make and version issues.
 
C

Conax

I suppose it's not a company policy. But this page is one to be added to
existing site which was designed and developed without frames so I can't use
frames now.

Thanks for your response, Mark.
Conax
 
R

Roland Hall

Conax said:
But this page is one to be added to
existing site which was designed and developed without frames so I can't use
frames now.

That's an incorrect statement. You may not WANT to use frames but you can.
Other pages have nothing to do with this one using frames. You can have a
single frame page in your site and aside from the pages loaded into the
frames, the rest do not have to be.

However, you're way ahead of yourself here.

1. What is the data that needs to be refreshed?
2. How is it retrieved?
3. From where?

Ex.

1. Text and/or image(s)
2. From a database/file
3. Manually edited/Server-side scripting with client-side timer./Server-side
application

I do have one question. Why is it so important that the page not refresh?
This probably doesn't have to be answered now but refreshing a page for one
element is not necessarily bad unless it has to make a trip to a server
needlessly but then if you're getting data and/or images dynamically, you're
hitting a database or a file somewhere or you're just pulling info from an
array or some other part of memory. If the rest of the page does not
change, then it will be reloaded from cache, unless the user has set the
browser to verify the page on each refresh. Usually only developers have
this set during development which means mine stays that way.

Ex. On the Snitz forum I'm running on one of my sites, there is a Famous
Quotes section. It randomly picks a quote from an array and displays
different ones on a timer. The array is populated when the page loads so
the data changes but there is no overhead going back to the server. This
could just as easily be done with images that were preloaded as in a roll
over.

If the data does actually change and require a trip somewhere to get it,
then this point is moot but it does not necessarily mean the whole page will
then have to be loaded. If there is no way around it, an IFRAME could be a
way out but note that IFRAMES have had security issues in the past, which I
believe was cross-site scripting, and this can be disabled on the user's
browser which will negate your workaround. If this is on an Intranet then
that's also not an issue because this site can be in a different security
zone where IFRAMES are allowed.
Creating an ActiveX control is also not an option of us...

Perhaps one already exists for what you need thus not requiring it to be
created. Would that then make it an option?

The three questions from the ordered list should be answered first and then
possibly someone can work out a solution for you. There are numerous
possibilities but more information is needed.

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
 
C

Conax

Thanks Roland! Your detailed information is much appreciated.

First the answers for the three questions:
1. It is going to be an online discussion session between us and our
customers. The data will be the questions our customers ask and the answers
we reply.
2. Data (questions and answers) will be stored on SQL server. When a
customer askes a question, it is saved into database. We then load the
question onto our manager webpage and answer it. The answer is then written
to database also. Next time the customer refreshes his page (or just that
section of the page), he will see his question and our answer, along with
other customers questions/answers in the QA area on the page.
3. I suppose answer 2 has answered question 3 as well?

We will refresh the whole page if there is no easy way to refresh just the
QA area of the page. Data/Images link on other parts of the page comes from
database too, therefore we hope we don't need to reload all that each time a
customer refershes the page.

As for the single frame page, I'm not sure how that's going to work, as we
need to keep this page the exact same layout as other pages on the site.
(Every page includes the header/footer...etc files to make the pages
consistent).

Regards,
Conax
 
R

Roland Hall

Hi Conax...

Conax said:
Thanks Roland! Your detailed information is much appreciated.
You're welcome.
First the answers for the three questions:
1. It is going to be an online discussion session between us and our
customers. The data will be the questions our customers ask and the answers
we reply.

This sounds like only text.
2. Data (questions and answers) will be stored on SQL server. When a
customer askes a question, it is saved into database. We then load the
question onto our manager webpage and answer it. The answer is then written
to database also. Next time the customer refreshes his page (or just that
section of the page), he will see his question and our answer, along with
other customers questions/answers in the QA area on the page.
3. I suppose answer 2 has answered question 3 as well?

We will refresh the whole page if there is no easy way to refresh just the
QA area of the page. Data/Images link on other parts of the page comes from
database too, therefore we hope we don't need to reload all that each time a
customer refershes the page.

As for the single frame page, I'm not sure how that's going to work, as we
need to keep this page the exact same layout as other pages on the site.
(Every page includes the header/footer...etc files to make the pages
consistent).

Regards,
Conax

I haven't forgotten about you. I'm working on it. I'll post when I'm done.

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
 
R

Roland Hall

Ok. I have a working model. Let me know if this will work for you and I'll
make the code available.

I created a database:
conax.mdb

table:
table1

fields:
id (autogenerated)
field1 (text 50)

I have an input page: // add records to the database here
link:
http://kiddanger.com/lab/conaxform.asp

And I have a report page:
link:
http://kiddanger.com/lab/conaxframeset.asp

Frameset contains two pages:
http://kiddanger.com/lab/conaxfront.asp
http://kiddanger.com/lab/conaxback.asp

Conaxfront.asp has a scrollable DIV which is what will be updated.
The timer on conaxback.asp will call a function that will reload this page
in the hidden frame. This is the engine.
This page will make a trip to the server to gather the current records.
It will clear the DIV in the conaxfront frame and then populate it with the
current records from the database.
--Note: If you were going to have a lot of records, I would maintain an
index and just add the additional record. I'm not sure what the performance
difference would be but for this application, it didn't sound like you would
have that many.
The rest of the page is not affected.
I put an animated image on the frame to show you it does not get reloaded
when the timer updates the records displayed.
I didn't build a fancy interface and I don't have a page to delete or modify
records but that's not part of this scope.

You have to add records and then monitor the report page. The timer will
update the page every 60 seconds.

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
 
C

Conax

Thanks again Roland for going through all these troubles. Your kindness is
so much appreciated. If you were somewhere near me I'd buy you some
chocolates!

I'll test your pages tonight.

Regards,
Conax
 
R

Roland Hall

Conax said:
Thanks again Roland for going through all these troubles. Your kindness is
so much appreciated. If you were somewhere near me I'd buy you some
chocolates!

I'll test your pages tonight.


You're welcome and thanks.
Look over your right shoulder! *smirk*

Mmmmmmm...chocolate! (Homer Simpson voice)

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
 

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,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top