当我单击“删除"按钮时,Javascript引发错误

编程入门 行业动态 更新时间:2024-10-28 12:20:32
本文介绍了当我单击“删除"按钮时,Javascript引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我按下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引发错误

本文发布于:2023-10-24 09:16:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1523548.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:当我   单击   按钮   错误   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!