关闭子例程的正确语法 [英] Right syntax for a closing subroutine

查看:71
本文介绍了关闭子例程的正确语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个子程序不正确。



当退出网页时,这应该执行。



那里在某些情况下,这不会像停电一样,重新启动或关闭计算机,拔下桌面插头等等。



 受保护的  Sub  Page_Close( ByVal 发​​件人作为 对象 ByVal  e  As  System.EventArgs)句柄  .Unload 
' 代码
结束 Sub





ASP.net关闭的正确语法是什么子程序?

解决方案

您希望在任何情况下都能参与其中吗?

如果客户端电源出现故障,您认为系统应该向所有服务器发送什么消息?更重要的是,如何?



当电源出现故障时,处理器停止运行。没有更多的消息,无论是进出。想一想:如果您家中的电源出现故障,您是否有时间查看您正在阅读的书中的页码,以确保您可以从同一点继续?



页面没有关闭,所以你赢了; t得到事件,所以不会调用该函数。


它是一个Page事件,不应该在情况下触发例如断电,重新启动或关闭计算机,拔下桌面插头等。简单来说,它不会起作用。


This subroutine is not correct.

When exiting a webpage this should execute.

There are some cases this will not engage like a power outage, restarting or shut down the computer, pulling the plug on a desktop, etc.

Protected Sub Page_Close(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
    'code
End Sub



What is the right syntax for a ASP.net closing subroutine?

解决方案

How the heck do you expect that to be engaged under all circumstances?
If the power fails on the client, what message do you suppose the system should send to all servers? And more to the point, how?

When the power fails, the processor stops running. No more messages, in or out. Think about it: if the power fails in your home, do you have time to look at the page number in the book you are reading to make sure you can continue from the same point?

The page is not closed, so you won;t get the event, so the function will not be called.


Its a Page Event , not supposed to fire on circumstances likepower outage, restarting or shut down the computer, pulling the plug on a desktop, etc.. To be simple, it wont work.


这篇关于关闭子例程的正确语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆