asp.net update UI using multi-thread

前端 未结 3 1018
栀梦
栀梦 2020-12-16 05:35

I have an ASP.NET website containing the following


     
          

        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-16 06:33

    This won't do what you think it will.

    It would make more sense to use a js timer on the front end to call a webmethod that updates the page.

    Remember that to the server, once the page is rendered to you, it does not exist anymore until called again. The web is a stateless medium. Postback and viewstate make it feel like it's not, but it really is.

    As such, you won't be able to call the client from the server, which is what you are attempting to do.

提交回复
热议问题