问题如下:
base {System.Runtime.InteropServices.ExternalException} = {"只有在配置文件或 Page 指令中将 enableSessionState 设置为 true 时,才能使用会话状态。还请确保在应用程序配置的 \\\\ 节中包括 System.Web.SessionStateMod 或自定义会话状态模块。"}
解决办法: 在初始化Session之前,用一个static静态修饰符先进行内存分配,即可获得Session值:
static Com.Netmarch.Model.SessionAdmin sessionid = new Com.Netmarch.Model.SessionAdmin();