开发者

which c# event will be fired after the webpage gets loaded?

开发者 https://www.devze.com 2023-03-20 12:00 出处:网络
I want to do some activity on backend means I want to run my code after the page gets loaded in the browser,which c# event gets fired when page loading completes?

I want to do some activity on backend means I want to run my code after the page gets loaded in the browser,which c# event gets fired when page loading completes? Or In which c# e开发者_Python百科vent should i write Code ?

Please help and suggest..


You can not run code on backend after the page get loaded in the browser.

You can do some activity in the browser using javascript.


Assuming you are looking at ASP.Net pages/forms (not MVC) then I recommend you take a look at the page lifecyle documentation: http://msdn.microsoft.com/en-us/library/ms178472.aspx

This documentation will talk you through these events:

which c# event will be fired after the webpage gets loaded?


You cannot do any thing or run any code at server once output is sent to browser. Use ajax on load to what you want to do. More specific requirement will help solving your issue. What are you trying to achieve. You need to understand basic structure how server and client do processing and interacts.


After the page is loaded you can not do anything with the page in server side (c#), you should use javascript (ajax) to interact with the server after the page is loaded or use html5 sockets.

But do you want to interact with the page that was loaded or just do some backend work, if it's some backend work that won't interact with the page you can use a Messaging Server (rabbitmq, wcf) to do stuffs....and if those stuff are needed to show on the page you can use cometjs to poll/push the results or html5 sockets to connect to the server and do some push stuff to the page......

....


You can use the LoadComplete event.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号