你加
if(!IsPostBack)
没有??
GridView和DataGird有一个小小的Bug,假如删除这个列而页面没有更新再删除的话会黄页
还有一个Index的Bug.
if(!IsPostBack)
没有??
GridView和DataGird有一个小小的Bug,假如删除这个列而页面没有更新再删除的话会黄页
还有一个Index的Bug.
解决方案 »
- 同一台电脑不同ID同时登录出现的session问题。
- 任务管理模块的数据库设计
- 做过查询系统请给点思路建议谢谢
- 請教一下將2進制流圖片文件顯示在Image控件裏
- 数据库权限更改问题
- 求NET大局观和Microsoft.NET框架程序设计(中文版) 的下载地址
- 谁知道模式窗口?给俺介绍介绍。让俺也了解了解
- asp.net中static的问题
- 重写了TextBox,希望当用户按下回车时执行指定的事件,为什么RaisePostBackEvent没有运行呢?
- Global.asax文件怎么用?
- 請問怎樣在datagrid中的header或footer中顯示自定義的文字?
- DataList 套一个无缝跑马灯效果
//if (!IsPostBack)
//{
// TxBpj.Text = ""; // if (e.CommandName == "Select")
// {
// int rowIndex = ((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex;
// string id = Gvshare.Rows[((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex].Cells[0].Text.ToString(); // SqlDataReader dr;
// SqlDataReader psdr;
// dr = DB.ReturnWorkDatasetcontent(Convert.ToInt32(id));
// psdr = DB.ReturnWorkDatasetpscontent(Convert.ToInt32(id), Session["usernameguid"].ToString());
// while (dr.Read())
// {
// Lbname.Text = dr["username"].ToString();
// Lbtime.Text = Convert.ToDateTime(dr["workdate"].ToString()).ToString("yyy-MM-dd"); // Lbtitle.Text = dr["worktitle"].ToString();
// Lbcontent.Text = dr["workcontent"].ToString();
// Lbbz.Text = dr["workbz"].ToString();
// Label2.Text = dr["workid"].ToString();
// Label4.Text = dr["usernameguid"].ToString(); // LbBool.Text = "未批示";
// }
// while (psdr.Read())
// {
// TxBpj.Text = psdr["pscontent"].ToString();
// LbBool.Text = psdr["psbool"].ToString();
// } // LbBool.Visible = true; // Lbname.Visible = true;
// Lbtime.Visible = true; // Lbtitle.Visible = true;
// Lbtitle.Visible = true;
// Lbcontent.Visible = true;
// Lbbz.Visible = true;
// Label1.Visible = true;
// TxBpj.Visible = true;
// Btnpj.Visible = true;
// }
//}
if (!IsPostBack) ,无法显示数据 protected void Gvshare_RowCommand(object sender, GridViewCommandEventArgs e)
{if (!IsPostBack)
{ // TxBpj.Text = ""; // if (e.CommandName == "Select")
// {
// int rowIndex = ((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex;
// string id = Gvshare.Rows[((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex].Cells[0].Text.ToString(); // SqlDataReader dr;
// SqlDataReader psdr;
// dr = DB.ReturnWorkDatasetcontent(Convert.ToInt32(id));
// psdr = DB.ReturnWorkDatasetpscontent(Convert.ToInt32(id), Session["usernameguid"].ToString());
// while (dr.Read())
// {
// Lbname.Text = dr["username"].ToString();
// Lbtime.Text = Convert.ToDateTime(dr["workdate"].ToString()).ToString("yyy-MM-dd"); // Lbtitle.Text = dr["worktitle"].ToString();
// Lbcontent.Text = dr["workcontent"].ToString();
// Lbbz.Text = dr["workbz"].ToString();
// Label2.Text = dr["workid"].ToString();
// Label4.Text = dr["usernameguid"].ToString(); // LbBool.Text = "未批示";
// }
// while (psdr.Read())
// {
// TxBpj.Text = psdr["pscontent"].ToString();
// LbBool.Text = psdr["psbool"].ToString();
// }
// LbBool.Visible = true; // Lbname.Visible = true;
// Lbtime.Visible = true; // Lbtitle.Visible = true;
// Lbtitle.Visible = true;
// Lbcontent.Visible = true;
// Lbbz.Visible = true;
// Label1.Visible = true;
// TxBpj.Visible = true;
// Btnpj.Visible = true;
// }
//}
代码是加在整个事件中的。试过其他电脑还是不行
protected void Gvshare_RowCommand(object sender, GridViewCommandEventArgs e)
{