2009-01-25 67 views
0

我正在開發一個遵循3層架構的web應用程序。當我點擊提交按鈕時數據存儲在數據庫中,但沒有顯示響應消息,如「記錄提交成功」,字段不是令人耳目一新。這裏是我的代碼:提交後刷新頁面需要幫助

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; 

     } 


    } 

感謝, Masum

回答

1

而不是使用的Response.Write,設置一個標籤,如labelResults顯示的結果。 Response.Write不會顯示在您呈現的HTML中的正確位置。

+0

謝謝先生.........它現在工作的很好。 – 2009-01-25 06:31:00