大耳朵爱被被
2016-05-10 10:03asp.net中session参数问题
修改密码网页的load代码如下:
if(Session["userName"]==null)
{
Response.Write("已经超时!");Response.End();
}
pswModify1.tableName = "管理员";
pswModify1.userName = Session["userName"].ToString();
Session.Remove("userName");
判断session不为空,出现了脚本错误,如下图:
登陆界面相关代码如下:(不知道session定义变量的位置对不对)
case "管理员":
{
string strSelect = "select count(*)from 管理员 where 用户名='" + strUserName + "'and 密码='" + strPassword + "'";
System.Data.SqlClient.SqlCommand selectCom = new System.Data.SqlClient.SqlCommand(strSelect, conn);
int count = int.Parse(selectCom.ExecuteScalar().ToString());
conn.Close();
if (count > 0)
{
Session["userName"] = txtUserName.Text;
Response.Redirect("welcomemanager.aspx");
}
else
{
Label1.Text = "用户名或密码输入错误!";
}
}
不知道问题出现在那里,有劳解答,谢谢你。
- 点赞
- 回答
- 收藏
- 复制链接分享
2条回答
为你推荐
- 使用View中的参数链接到Controller函数(CodeIgniter)
- codeigniter
- php
- 1个回答
- 微信H5支付,如何在后台.cs文档中调用前台JS的callpay()方法。ASP.NET
- javascript
- 支付
- 微信
- asp.net
- 3个回答
- python爬取ashx页面的post请求
- python
- ashx
- post data
- 2个回答
- ASP.net购物车 session datatable
- asp.net
- 1个回答
- asp.net中session参数问题
- 2个回答
换一换