Note that there are some explanatory texts on larger screens.

plurals
  1. POC# web application javascript alert in code behind
    text
    copied!<p>I want to create a <code>Javascript</code> alert in an <code>asp.net</code> web application. But i can't able to create this. I post my partial code is here the script manager javascript alert not displayed. Please help me to show the javascript alert..</p> <pre><code>if (noofday &gt; 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", "&lt;script language='javascript'&gt;alert('Request sent successfully. Go and watch your status..');&lt;/script&gt;", 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", "&lt;script language='javascript'&gt;alert('Request sent successfully. Go and watch your status..');&lt;/script&gt;", false); clear(); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload