css部分 这是添加用户的方法 但是A.AdminName 和后面的A.取到的都是空值protected void GridView1_RowCommand(object sender,GridViewCommandEventArgs e)
{if (e.CommandName == "Insert")
{ Admins A = new Admins();
var footer = ((GridView)sender).FooterRow;
A.AdminName = ((TextBox)footer.Cells[1].FindControl("txtnewname")).Text;
A.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(((TextBox)footer.Cells[1].FindControl("txtnewPwd")).Text, "MD5");
A.AdminType = ((TextBox)footer.Cells[1].FindControl("txtAdminNewType")).Text;
A.State = true;
AC.AddAdmin(A);
BindAdmin(); }}收起
{if (e.CommandName == "Insert")
{ Admins A = new Admins();
var footer = ((GridView)sender).FooterRow;
A.AdminName = ((TextBox)footer.Cells[1].FindControl("txtnewname")).Text;
A.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(((TextBox)footer.Cells[1].FindControl("txtnewPwd")).Text, "MD5");
A.AdminType = ((TextBox)footer.Cells[1].FindControl("txtAdminNewType")).Text;
A.State = true;
AC.AddAdmin(A);
BindAdmin(); }}收起
在线等 需要aspx程序部分可以直接联系我
var footer = ((GridView)sender).FooterRow;
这个是不是有问题 又 不是js 竟然var 声明变量
作 者:源码站长资源交易专业网-16aspx.com 文章出处:http://www.16aspx.com