WebアプリケーションJavascript
でアラートを作成したい。asp.net
しかし、私はこれを作成することはできません。部分的なコードをここに投稿します。スクリプトマネージャーのjavascriptアラートが表示されません。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();
}