Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I need to display alert message box while run the output through breakpoint and continue to the next method. But it skips the alert message box... Ex: I need this below code in Asp.net

Sample Code:
C#
if (bIsMsg == true)
{
strMsg = "Employeee 2Half Salary has been updated successfully to the Employee - '" + txtEmployeeName.Text + " for " + ddlmonth.Text + " - " + ddlyear.Text + "' ";
// MessageBox.Show(strMsg, Properties.Settings.Default.ProductName.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "salary", "alert('" + strMsg + "');", true);
}
Posted
Updated 27-Aug-14 20:27pm
v6
Comments
Gihan Liyanage 28-Aug-14 1:28am    
did you set debug mode to release mode in visual Studio ?
Member 11041796 28-Aug-14 1:32am    
no
Member 11041796 28-Aug-14 1:40am    
Yes just now changed to release... then ?
Sergey Alexandrovich Kryukov 28-Aug-14 1:44am    
No code sample, no advice...
—SA
Member 11041796 28-Aug-14 1:49am    
Sample Code:
if (bIsMsg == true)
{
strMsg = "Employeee 2Half Salary has been updated successfully to the Employee - '" + txtEmployeeName.Text + " for " + ddlmonth.Text + " - " + ddlyear.Text + "' ";
// MessageBox.Show(strMsg, Properties.Settings.Default.ProductName.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "salary", "alert('" + strMsg + "');", true);
}

1 solution

What you are writing is C# server side code which executes on the server. so while debugging, it won't display the alert box(as it runs on the client). Why do you even want to do that ?
1st of all, alert is an old way of display popup mode in browsers. It doesn't conform to new UX standards. try jquery ui dialog etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900