我想在asp.net
Web應用程序中創建Javascript
警報。但我無法創造這個。我發佈我的部分代碼是在這裏腳本管理器JavaScript警報沒有顯示。請幫我顯示JavaScript警告..C#web應用程序javascript代碼中的警報
if (noofday > totalday)
{
// I want to display the confirm message box in this section
ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "return confirm('Are you sure you want to delete');", true);
if(true)
{
DataSet5TableAdapters.sp_inleaverequestTableAdapter TA = new DataSet5TableAdapters.sp_inleaverequestTableAdapter();
TA.GetData(lbl_empcode.Text, lbl_empname.Text, lbl_dept.Text, txtfromdate.Text, txttodate.Text, Convert.ToString(noofday), ddlleavetype.SelectedItem.Text, Convert.ToString(totalday), txtreason.Text, ddlforward.SelectedItem.Text, " ", " ", " ", " ", lbl_date.Text);
Send_Email(lbl_empcode.Text, lbl_empname.Text, txtfromdate.Text, txttodate.Text, noofday, ddlleavetype.SelectedItem.Text, txtreason.Text);
clear();
ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('Request sent successfully. Go and watch your status..');</script>", false);
}
else
{
//DO Something
}
}
else
{
DataSet5TableAdapters.sp_inleaverequestTableAdapter TA = new DataSet5TableAdapters.sp_inleaverequestTableAdapter();
TA.GetData(lbl_empcode.Text, lbl_empname.Text, lbl_dept.Text, txtfromdate.Text, txttodate.Text, Convert.ToString(noofday), ddlleavetype.SelectedItem.Text, Convert.ToString(totalday), txtreason.Text, ddlforward.SelectedItem.Text, " ", " ", " ", " ", lbl_date.Text);
Send_Email(lbl_empcode.Text, lbl_empname.Text, txtfromdate.Text, txttodate.Text, noofday, ddlleavetype.SelectedItem.Text, txtreason.Text);
ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('Request sent successfully. Go and watch your status..');</script>", false);
clear();
}
看看這個, http://stackoverflow.com/questions/4779576/how-to-display-windows-form-messagebox-in-asp-net-web-application – SuganR 2012-08-08 13:57:32
我需要在web應用程序中的消息框不在Windows應用程序.. – 2012-08-08 14:01:57
回答爲你的問題是在這個鏈接,請看正確, http://stackoverflow.com/questions/4779576/how-to-display-windows-form-messagebox-in-asp-net- web應用程序 這僅適用於Web應用程序。 – SuganR 2012-08-08 14:05:42