关于在ASP.NET如何使用AjaxPro,这里就不多说了,先看代码:
[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)]
public string btnNextZX(string data)
{
StringBuilder zx_Ret = new StringBuilder();
Hashtable hash = (Hashtable)Session["jgd_data"];
public string btnNextZX(string data)
{
StringBuilder zx_Ret = new StringBuilder();
Hashtable hash = (Hashtable)Session["jgd_data"];
注意:这里排除Session中没有["jgd_data"]这个数据而引起的出错,当然即使不存在也报的并不是如下的错误:
很奇怪!我明明加了如下代码啊!!
[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)]
解决办法:
将如下代码行:
Hashtable hash = (Hashtable)Session["jgd_data"];
替换成如下代码:
Hashtable hash = (Hashtable)HttpContext.Current.Session["jgd_data"];
执行OK!!