当我所有非空验证都通过时,才出现提示"处理中"对话呢?
打算实现的效果:
,,当所有非空验证都通过时,出现下面提示对话:
,现在的问题是:一点击“启动”,验证还未通过时就出现下面的效果:
,我把代码贴出来,高手们帮我看看:
protectedvoid Page_Load(objectsender, EventArgs e)
{
this.Btn_Submit.Exp_SubmitLoad();
}
protectedvoid Btn_Submit_Click(object sender, EventArgs e)
{
#regionset data
stringSqlPath = "/database/SystemDB.sql";
stringIP = this.txtServer.Text.Trim();
if(IP.Length <= 0)
{
this.Exp_PageAlter("请先输入数据库服务器地址");
return;
}
stringUserName = this.txtUserName.Text.Trim();
if(UserName.Length <= 0)
{
this.Exp_PageAlter("请先输入数据库登录用户名称");
return;
}
#endregion
try
{
varmsg = "";
CodeHelper.begin(IP,UserName, UserPwd, SqlName, SqlPath, ref msg);
this.lbResult.Text= msg;
}
catch(Exception ex)
{
this.lbResult.Text
= "数据初始化失败,错误信息如下:\r\n" +
ex.Message.Exp_SubStringByLength(1000, "…");
}
}
其中:Btn_Submit.Exp_SubmitLoad方法如下:
public static void Exp_SubmitLoad(this Buttonbtn)
&n