Best way to update my .aspx site with a timer in C #?

I have a default.aspx page that needs to be updated every 10 seconds.

My solution is still a javascript function, but it only works in Firefox and not in IE.

I am looking for a way to handle mecanism updates on the default.aspx.cs page instead with some type.

Any good simple tips / tricks or solutions that can lead me in the right direction?

+3
source share
4 answers

There is a timer in the toolbar that is included in ms ajax. Add a ScriptManager, place the content you want to update inside the UpdatePanel, and then add an ajax timer.

.

aspnet ajax

, , .

+4

<meta> , :

<meta http-equiv="refresh" content="10" />

JavaScript, ( ) .

+5

, Meta refresh - ,

<meta http-equiv="refresh" content="10" />

, 10 . , , , ajax .

+3

I used jquery to successfully refresh the page, and it also works in IE.

$(document).ready(function() {
         $("#content_1").load("yourSite.aspx");
       var refreshId = setInterval(function() {
          $("#content_1").load('yourSite.aspx');
       }, 5000);
    });
+2
source

Source: https://habr.com/ru/post/1749597/


All Articles