dal层 session 问题

sh1618 sh1618 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
问题:根据不同用户登录 连接不同数据库


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 结贴 给分
...全文
评论 4
收藏 已收藏
分享
返回顶部
sh1618
.NET社区 62,274 成员 668,968 内容