Santhosh Uj

Santhosh Uj

  • NA
  • 71
  • 3.2k

Uncaught SyntaxError: missing ) after argument list

Dec 21 2018 5:27 AM
private void MessageBox(string msg)
{
ScriptManager.RegisterClientScriptBlock(this, GetType(), "startscript", "<script>alert('" + msg + "');</script>", false);
}
 
 
protected void btnDelete_OnClick(object sender, ImageClickEventArgs e)
{
string msg = "";
//deleting is violating foreign key constrain
GridViewRow row = (GridViewRow)((ImageButton)sender).NamingContainer;
msg = deleteDetails1.DeleteCourseMaster(Convert.ToInt32(gridReport.Rows[row.RowIndex].Cells[2].Text));
BindGrid();
ClearControls();
MessageBox(msg);// this code is throwing error as  Uncaught SyntaxError: missing ) after argument list
}
 
 
and the msg contains:
SQL Error:<br/>The DELETE statement conflicted with the REFERENCE constraint "FK_VacancyMaster_CourseMaster". The conflict occurred in database "GFR_New", table "dbo.VacancyMaster", column 'CourseID'.
The statement has been terminated.The DELETE statement conflicted with the REFERENCE constraint "FK_VacancyMaster_CourseMaster". The conflict occurred in database "GFR_New", table "dbo.VacancyMaster", column 'CourseID'.
The statement has been terminated. 
 
 
when i directly pass string as
MessageBox("Something");
 
alert box is working for passing msg string throwing error
 
PS: msg is already declared as string and assigned with null
 
 
 
thanks in advance

Answers (1)