Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 提交后刷新页面需要帮助吗_Asp.net - Fatal编程技术网

Asp.net 提交后刷新页面需要帮助吗

Asp.net 提交后刷新页面需要帮助吗,asp.net,Asp.net,我正在开发一个遵循三层架构的web应用程序。当我点击提交按钮时,数据存储在数据库中,但没有显示响应消息,如“Record submitted successfully”,字段也没有刷新。这是我的密码: protected void BtnSubmit_Click(object sender, EventArgs e) { if (!Page.IsValid) return; NewuserBAL NUB = new Newuser

我正在开发一个遵循三层架构的web应用程序。当我点击提交按钮时,数据存储在数据库中,但没有显示响应消息,如“Record submitted successfully”,字段也没有刷新。这是我的密码:

protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
            return;

        NewuserBAL NUB = new NewuserBAL();    

        string UserName = TxtUserName.Text;
        string Password = PWD.Text;
        string EmailId = Email.Text;

        try
        {
            NUB.newinsert(UserName, Password, EmailId);
            Response.Write("<b>New User Created Successfully</b>");
            TxtUserName.Text = "";
            PWD.Text = "";
            CnfrmPwd.Text = "";
            Email.Text = "";
        }
        catch
        {
            throw;

        }

        finally
        {
            NUB = null;

        }


    }
protectedvoid BtnSubmit\u单击(对象发送方,事件参数e)
{
如果(!Page.IsValid)
返回;
NewuserBAL NUB=newnewuserbal();
字符串UserName=TxtUserName.Text;
字符串密码=PWD.Text;
字符串EmailId=Email.Text;
尝试
{
NUB.newinsert(用户名、密码、电子邮件ID);
Response.Write(“新用户创建成功”);
TxtUserName.Text=“”;
PWD.Text=“”;
CnfrmPwd.Text=“”;
Email.Text=“”;
}
抓住
{
投掷;
}
最后
{
NUB=null;
}
}
谢谢,
Masum

而不是使用Response.Write,设置标签(如labelResults)以显示结果。Write不会显示在呈现的HTML中的正确位置