How do i refresh a webpage without running the code behind again.
Posted on 2011-02-28
I have a webpage that has 5 gridviews on it. In the code behind I have a method that checks the status of an IP address on my network. The results are then displayed on one of the gridview. The problem is, this method take up to a minute to run so everytime I load the webpage, it takes forever to load.
I then placed this method in a seperate thread so the webpage loads straight away and my method is running on the seperate thread. What I would like is for the method to finish and then update the gridview but I don't want the page to refresh and run the code behind again.
This is the client side code that I'm using to refresh the page
<meta http-equiv="refresh" content="100">
I've tried adding the following in my page load event but the thread seems to be triggered every time.
If Not Page.IsPostBack Then
Can anyone help me with this or suggest an alternative way I can update my gridview when the method has finished running.
One last thing, If I don't have the thread, my gridview does populate but like I said I have to wait a while before my page is displayed.