dal层 session 问题
问题:根据不同用户登录 连接不同数据库
运行System.Web.HttpContext.Current.Session["ConStr"]
字符串读出来了
但是前台页面的 ajax 不运行
eg:
$(function () {
$.ajax({
url: "test.ashx",
type: "post",
async: false,
dataType: "text",
data: { Type: "loginsubbanner", page: "1" },
success: function (html) {
}
});
}
是不是运行session 结束了 回话状态
有什么好的解决方案
没有分了 请回复一下 http://bbs.csdn.net/topics/391897995 结贴 给分
public static string ConnectionString
{
get
{
string _connectionString = ConfigurationManager.ConnectionStrings["GTADBConnection"].ConnectionString;
if (System.Web.HttpContext.Current.Session["ConStr"] != null)
{
_connectionString = System.Web.HttpContext.Current.Session["ConStr"].ToString();
}
return _connectionString;
}
}
运行System.Web.HttpContext.Current.Session["ConStr"]
字符串读出来了
但是前台页面的 ajax 不运行
eg:
$(function () {
$.ajax({
url: "test.ashx",
type: "post",
async: false,
dataType: "text",
data: { Type: "loginsubbanner", page: "1" },
success: function (html) {
}
});
}
是不是运行session 结束了 回话状态
有什么好的解决方案
没有分了 请回复一下 http://bbs.csdn.net/topics/391897995 结贴 给分
...全文


