指定 GridWeb 存放临时会话文件的路径
Contents
[
Hide
]
当 GridWeb 会话模式为 ViewState 时,它将其临时会话文件存储在应用程序基目录中。有时,将临时会话文件存储在那里是不可行的,因为应用程序基目录可能没有对其的写权限。在这种情况下,GridWeb 会抛出这样的异常
[UnauthorizedAccessException: Access to
the path 'D:</span>inetpub</span>wwwroot</span>AsposeExcelTest</span>gwb_tempGridWeb1' is denied.]
上述问题的解决方案是使用 GridWeb.SessionStorePath 属性授予对应用程序基本目录的写入权限或更改具有写入权限的 GridWeb 临时会话文件路径。此路径应相对于应用程序基目录。
指定 GridWeb 存放临时会话文件的路径
以下示例代码指定了 GridWeb 存储临时会话文件的路径。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
GridWeb1.SessionStorePath = "mytempdir/session"; |