Last post Jul 16, 2018 01:49 AM by Abraham Qian
Jul 10, 2018 06:23 AM|Hon123456|LINK
I have a page which will run a function which takes 3 to 4 minutes. Now, if I want to change to another page, the original page keeps running and take a while to switch to another page. How can I switch to another page quickly and not need to wait for
a while of the original page?
Jul 10, 2018 07:59 AM|uid895650|LINK
If I had this issue, I would look at running a background task.
It depends on your .NET Framework version but these links should get you going.
Jul 10, 2018 08:09 AM|Hon123456|LINK
But I just want to stop the page loading process where I press a menu click and switch to another aspx. Is it going to use background task?
Jul 10, 2018 01:00 PM|markfitzme|LINK
Not at all. This will have nothing to do with ASP.Net. This is completely the browser and how it is handling events. If it's waiting and receiving data, it will wait to receive data. If a click on a link is slow there won't be anything you can do with that.
The browser is just busy doing something.
Jul 10, 2018 02:24 PM|uid895650|LINK
It sounds like this is client side related. If the browser is slow and then you want to stop it, this is specific to the user.
Clicking a link or simply redirecting the user would solve your problem but it won't have finished processing the original request. I think that for some requests from the client, the server does not respond, or the response time is too long. We could limit
the request time by setting the web server's timeout. For details, please check the related web server, such as KeepAliveTimeout, client_header_timeout, send_timeout attributes. Check https://msdn.microsoft.com/en-us/library/e1f13641(v=VS.100).aspx
Jul 11, 2018 07:07 AM|Abraham Qian|LINK
In my opinion, I think that for some requests from the client, the server does not respond, or the response time is too long. We could limit the request time by setting the web server's timeout. For details, please check the related web server, such as KeepAliveTimeout,
client_header_timeout, send_timeout attributes, etc.
Jul 12, 2018 08:43 AM|Hon123456|LINK
Seems the first request is busy at running function that makes the switch to other pages slowly. Is that making the function in the first request to background process will make it better?
Jul 16, 2018 01:49 AM|Abraham Qian|LINK
According to your description, I think your idea is constructive. If we implement the previous request via ajax, or it can be handled asynchronously by the background task. I suggest you do this. In addition, I think it is feasible to control request time
through the web server.
Feel free to let me know if you have any question.