是哪个操作出现了两次?把 Page_Load 事件中的代码作一下判断if(!IsPostBack)
{
SqlCommand comm=new SqlCommand("select [userinfo].userid from [userinfo] where [userinfo].username='"+Session["username"]+"'",cnn);
cnn.Open();
SqlDataReader sReader;
sReader=comm.ExecuteReader();
sReader.Read();
string g=sReader.GetString(0);
sReader.Close();
cnn.Close();
bookid.Text=(string)Session["bookid"];
string d=DateTime.Today.ToShortDateString();
nowtime.Text=d;
uidlb.Text=g;}
{
SqlCommand comm=new SqlCommand("select [userinfo].userid from [userinfo] where [userinfo].username='"+Session["username"]+"'",cnn);
cnn.Open();
SqlDataReader sReader;
sReader=comm.ExecuteReader();
sReader.Read();
string g=sReader.GetString(0);
sReader.Close();
cnn.Close();
bookid.Text=(string)Session["bookid"];
string d=DateTime.Today.ToShortDateString();
nowtime.Text=d;
uidlb.Text=g;}
解决方案 »
- 关于GridView启用排序时的安全问题
- 前台同时插入多入记录
- 有哪位用过Javascript for pdf?能够拦截willsave事件?
- 上传和显示图片的方法(到数据库)不报错没效果!~~
- ViewState为什存不住已改变DefaultView.Sort属性的dataTable的值呢,谢谢
- 超级链接前更新数据库怎么操作
- 怎么用javascript取得session?
- ASP.net可以访问另外的站点ASP吗,并且要保持会话
- XML的节点名字不能用非英文字母吗?
- 2013-11-17T11:59:22+08:00是什么时间格式?
- 关于地址栏传送变量问题
- DataList里出现的一个特别奇怪的问题。。高手进来看看!!
if not page.IsPostBack then
...
end if
<%@ Page AutoEventWireup=false %>