ASPX page updates

G

Guest

I am implmenting an aspx page that displays data from a database. I would
like the page to automatically update when the database changes. Does .NET
provide a mechanism that would cause a client web browser to perform a post
back that is initiated by the server side (possibly the users session
object). The process would be initiated by something like a database trigger.

The other option would be just to have the client continue to poll for
updates.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

No AFAIK,
you have two problems, how the client finds out that the Db changed and how
the web app knows the same.
The web app can poll the DB and look for a change, I can't think of the best
way right now but a trigger should be involved.

then the browser can poll the web app, you do not need to submit the entire
page, create a script that call a web page in the server and return a single
value, like the date of the last update then if it's different you can
submit the entire page.


Cheers,
 
G

Guest

James,

I believe that you will have to go with a client side implemetation here.
..Net does not provide a mechanism to refresh a browser from the server (to my
knowledge) but you can do this easily on the client side with a meta refresh
tag.

Hope this helps.
 
J

Joerg Jooss

James said:
I am implmenting an aspx page that displays data from a database. I
would like the page to automatically update when the database
changes. Does .NET provide a mechanism that would cause a client web
browser to perform a post back that is initiated by the server side
(possibly the users session object).

Do you really want a *post back*? That means resending a web form, which
usually triggers a warning message by the browser.

[...]
The other option would be just to have the client continue to poll for
updates.

You can use the non-standard HTTP header "Refresh" here.

// Causes a refresh every 10 seconds
Response.AppendHeader("Refresh", "10");

Cheers,
 

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

Top