I am making a application (in vb) to automatic update WEB page using MS SQL server. So fare so god. I am updating both picture and text.
My question is: Is it possible to automatic refresh asp page when there are new data on the SQL server
Depends what you mean. The asp has no way of telling the browser there is new data and then refresh, all you can do is set it to refresh the browser every 10 minutes or so using the refresh meta tag
pet41, are you building the entire page dynamically from the database or just using code to insert data into a template from the database?
You have to worry about both server side and client side caching. What I would suggest is to have your html template files use includes. The include files should be set not to cache and would execute the code to pull the data from the database.
The client browser will never cache server side code anyway but this way the templates and related files can cache normally for better performance but the dynamic content will not cache.
Performance could become an issue if it is a really busy site. You would have to look into what controls you have for flushing server side caching if you had to deal with performance issues.
You could use a trigger (insert and/or update) on your database to write a timestamp to a textfile every time the table is changed. Your asp would read the timestamp from the file and dynamically write the value into a client-side javascript variable.
Then you could use client-side script to create an instance of the xmlhttp object... a timer in the script would then ask the object to read the textfile on the server, parse the date to see if it is different and reload the web page if the two dates are not the same.
Yes, nice way to handle automatic updates.
I was thinking along the lines of "next time they load the page" rather than triggering updates to a page already loaded.
Any way though of making this work automatically if the client has disabled javascript?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.