Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在会话中存储aspx页面?_C#_Asp.net_Session - Fatal编程技术网

C# 如何在会话中存储aspx页面?

C# 如何在会话中存储aspx页面?,c#,asp.net,session,C#,Asp.net,Session,我在一次采访中问过这个问题。您能否解释一下,是否可以在一个会话中存储整个aspx页面。如果可能,我们应该使用哪种会话模式?你能给我提供任何链接或代码,让我对它有所了解。以自定义方式缓存页面的正确方法是 问题是,当从缓存请求项目或将项目添加到缓存中时,会话对象尚未创建,因此您无法使用会话存储页面。我想他/她想询问大型会话状态变量对服务器内存的影响,如果是,这可能会有所帮助 Disadvantage of using session state are: Performance considerat

我在一次采访中问过这个问题。您能否解释一下,是否可以在一个会话中存储整个aspx页面。如果可能,我们应该使用哪种会话模式?你能给我提供任何链接或代码,让我对它有所了解。

以自定义方式缓存页面的正确方法是
问题是,当从缓存请求项目或将项目添加到缓存中时,会话对象尚未创建,因此您无法使用会话存储页面。

我想他/她想询问大型会话状态变量对服务器内存的影响,如果是,这可能会有所帮助

Disadvantage of using session state are:
Performance considerations :
Session-state variables stay in memory until they are either removed or replaced,
and therefore can degrade server performance. Session-state variables 
that contain blocks of information, such as large datasets, can adversely affect
Web-server performance as server load increases.

有了可用的aspx页面缓存,这似乎是一个奇怪的要求。如果在会话中存储aspx,您将为许多对象请求、响应、上下文等设置根目录,从而阻止它们被垃圾收集器回收。如上所述,缓存是保存页面或部分页面的方式。