Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Don't refresh on reserve

Status
Not open for further replies.

cjburkha

Programmer
Jul 30, 2004
76
US
Hi,

I'm looking for a way to make a roundtrip to the server and comeback, but not refresh the whole page.

I did this a while ago, you can see here:


and select class=everyone event=picnic2004

Now when you select the picture from the left, the whole page does not refresh, just the picture.

This does not use JavaScript directly, but it does use maintain view state, which I know employes javascript.

Which leads to another question, in places where it makes sense, do think JavaScript and ASP.NET should be mixed? I started with a feeling that I wanted to do everything with server side, but this does not seem to be a good idea. But now I have things like, <asp:img onload="<% response.write(makeVisible) %>;"> where makeVisible is my call to a JavaScript function.

Thanks for your help, I hope this was clear enough.

CJB
 
Not entirely sure what you're talking about -

The whole page does refresh. Mind you, I do have my IE settings to check for newer versions of the page on every visit (my Firefox settings are default, and the page still refreshes)...

-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
 
On-topic:
Code:
Your image:
<asp:image id="img" ...

js code:
document.getElementById("img").attachEvent("onload", makeVisible);

Off-topic:
For the "non-refresh" request there are 2 main solutions:
1. Remote Scripting (ideal for combo fill)
2. XmlHttpRequest (or XmlHttp on IE)
You'll find lots and lots of samples and resources for both solutions on web (just try a google on them).

[morning]
 
Thanks Chip, I kind of suspected somthing like that happend since firefox does repaint the whole screen, while IE didn't. You can see the page doesn't work well in firefox, I wrote this before I started doing cross browser work.

Joulius, thanks for the code and the tip on XmlHttpRequest, thats a very good idea. Last time I used that function, Opera didn't work so well with it. Namely, it didn't return Readystate 1-4, only readystate 4. Do you have any experience with that?

Thanks for the ideas guys

CJB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top