Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would suggest that you first try to figure out if the code you expect is being returned to the page. </p> <p>There are few ways to do this, with the easiest being "View Source" on the page after your above code runs. If you can find that content in the page, you will know that the content is being returned to the page but not executed. </p> <p>If you do not see the content when viewing source, then you have a different problem. Either control is being passed to another page, or its not actually going to the if condition you expect. </p> <p>Once you understand where the problem originates from these two pieces, you can start to find what may be causing it. </p> <p>It is also somewhat apparent that you may not completely understand how the web works. Given this set of code....</p> <pre><code> 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); } </code></pre> <p>... it appears that you are expecting the page execution on the server to stop and then wait for the client to respond. This is not how the web page life cycle works. The server code is going to execute completely and send content back to the client. Its not an interactive process (even with AJAX) like a windows forms or console application.</p>
 

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