Reputation: 1398
I have an ASP.NET page, the menu comes from menu.ascx in masterpage.
Menu includes below items:
Request(5)
Info
In menu.ascx.cs, I calculate 5. It comes from a SQL query like
Select Count(*) From Request Where Id = 1; //returns 5
For instance; in other page, I edit any record and the result of query will be 6. But without refreshing page it does not change and still seems 5.
Are there any way to do it without refreshing page except for Ajax solutions? When I edited any record can I refresh all page?
Upvotes: 0
Views: 1113
Reputation: 15794
You can also look at the XmlHttpRequest object that is available in JavaScript. You can embed the script in your web page via the usual methods.
Upvotes: 1
Reputation: 16613
There is no way to get that updated in the browser without resorting to either one of these options:
A newer approach would be to make use of Websockets where you can push data from the server to the client. Microsoft has created a cool library, with various fallback scenarios, in SignalR.
Upvotes: 2
Reputation: 13360
Wrap the HTML you want refreshed in an UpdatePanel
, which will allow partial page updates. It is an AJAX-based solution, but there is no way to perform a partial page update with information from the server without using AJAX.
Upvotes: 2