当我按下RadGrid Control中的Delete按钮时.会引发错误 我的代码是:
When I press delete Button in RadGrid Control . it Throws Error My Code Is :
int id = 0; if (e.CommandName == "Delete") { GridDataItem item = (GridDataItem)e.Item; id = (int)item.GetDataKeyValue("RegId"); int Execid = (int)item.GetDataKeyValue("ExecId"); try { Controllers.ComplianceRegController.DeleteComplianceRegistration(id, Execid); Response.Write(@"<script language='javascript'>alert('Record Has Been Deleted')</script>"); } catch { Response.Write(@"<script language='javascript'>alert('Sorry! There Is Some Issue Related to Document.')</script>"); } }错误是:Microsoft JScript运行时错误:Sys.WebForms.PageRequestManagerParserErrorException:无法解析从服务器收到的消息.导致此错误的常见原因是通过调用Response.Write(),响应筛选器,HttpModules或服务器跟踪来修改响应. 详细信息:解析''< script language =''ja''附近的错误.
Error is : Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near ''<script language=''ja''.
推荐答案就我而言,它就像 在Single Cote('''')中编写脚本语言=''javascript''而不是在double Cote中写..然后它可以正常工作.. 还有另一种提醒消息的方式,例如 in my case it is like Write script language =''javascript'' in Single Cote('' '') not into double cote..then it work fine.. and another way for alert msg like ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:alert('Record Has Been Deleted.')", true);
谢谢
Thank you
更多推荐
当我单击“删除"按钮时,Javascript引发错误
发布评论