Web表单类范围 [英] Web forms classes scope

查看:63
本文介绍了Web表单类范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么定义了Web表单中的范围?



在正常的应用程序中,创建一个对象并存活,直到它被删除或应用程序关闭为止由垃圾收集器处理。



但是它如何用于Web表单?类是否包含它们所提供的所有信息,直到与服务器的连接丢失,或者它是否仅适用于某种类型(即全局?)。



非常感谢

What defines the scope in web forms?

In normal applications an object is created and "survives" until either it is deleted or the application is closed and is handled by the garbage collector.

But how does it work for web forms? Do classes hold all information they are given until the connection to the server is lost, or does it only apply to a certain type (ie global?).

Many thanks

推荐答案

ASP.NET代码完全由服务器端运行,而不是客户端。一切都存在,直到当前请求得到服务。在将页面发送回客户端之后,一切都会消失,当然,除非您存储需要在该客户端的Session对象中保留的任何数据。
ASP.NET code runs entirely server-side, not client. Everything survives until the current request is serviced. After the page is sent back to the client, everything dies, unless, of course, you store whatever data needs to be persisted in the Session object for that client.


这篇关于Web表单类范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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