Click here to Skip to main content
16,018,092 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I press delete Button in RadGrid Control . it Throws Error

My Code Is :


XML
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>");
               }
           }




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'.
Posted

1 solution

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

C#
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:alert('Record Has Been Deleted.')", true);


Thank you
 
Share this answer
 
v3
Comments
Akash Rangani 31-Aug-12 3:12am    
Thanks but, IT's not Working on my system. I think so it is because of Ajax that i put in UI.

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