if(Page.IsPostBack)
{
// Page.Validate();
// if(!Page.IsValid)
// {
// return;
// }
string UserLoginName = BSI.getParam(this.TextBox_UserLoginName.Text);
string UserLoginPass = BSI.getParam(this.TextBox_UserLoginPass.Text);
string UserNickName = BSI.getParam(this.TextBox_UserNickName.Text);string sqlConnStr = function.getConnStr();
SqlConnection sqlConn = new SqlConnection(sqlConnStr);
sqlConn.Open();
string sql = "p_passport_reg";SqlCommand mySqlCommand = new SqlCommand(sql,sqlConn);//给数据适配器生成selectCommand对象
mySqlCommand.CommandType = CommandType.StoredProcedure;
SqlParameter param;
// 增加输入参数
param = mySqlCommand.Parameters.Add("@UserLoginName", SqlDbType.VarChar, 80);
param.Value = UserLoginName;
param = mySqlCommand.Parameters.Add("@UserLoginPass" , SqlDbType.NVarChar , 50);
param.Value = UserLoginPass;
param = mySqlCommand.Parameters.Add("@UserNickName" , SqlDbType.NVarChar , 50);
param.Value = UserNickName;mySqlCommand.ExecuteNonQuery();
sqlConn.Close();
Response.End();
}

解决方案 »

  1.   

    Page.IsPostBack
    改为
    !Page.IsPostBack
      

  2.   

    因为页面刷新的时候又执行了一次,放到click方法里面
      

  3.   

    to
    Page.IsPostBack
    改为
    !Page.IsPostBack
    有没搞错
      

  4.   

    如果用Page.IsPostBack
    页面每刷新一次程序就会执行一次,楼主看着办吧
      

  5.   

    GDNPC(烟锁池塘柳,炮镇海城楼)我看你说反了吧
      

  6.   

    开玩笑
    改成!Page.isPostBack
    ,没有提交怎么取值啊
      

  7.   

    你可以把要执行的代码写在按钮的onclick事件里。