Click here to Skip to main content
Sign Up to vote bad
good
Hi all
I am doing batch editing in telerik mvc3.By clicking savechanges button in the grid it updates the database for this am using ajax options.if any error occurred while saving records an exception message is throwing but I want to display that exception message in my view page i tried this coding but not working properly
 function OnSuccess( e ) {
       var container =  $(".msg_container");    
        if(e.HasError==false)
            { 
                 var grid = $("#grdHolidays").data("tGrid");
                 grid.rebind(); 
                 alert("Saved");
            }
         else
            {    
                 showMessage(e.Message.MessageCode, e.Message.Message,                   e.Message.MessageType ,container);
                  alert("Error occurred");   
            }
    }  
I had called this function on OnSuccess event.Alert message "Error occurred" is coming but show message is not working. that MessageCode,message and messsagetype are having values also
Posted 20 Jul '12 - 0:38
Edited 20 Jul '12 - 0:45
Wes Aday59.2K


1 solution

If you look at the code markup applied in your code above you'll see that the it doesn't know what to do with it. Try an alert:
alert('Error: ' + e.Message.Message + ' ('+ e.Message.MessageCode +')');
Good luck!
  Permalink  
Comments
kulasekaran-M - 20 Jul '12 - 8:20
Thank you its working.if any possibilities is there to display the same in a <div> in my view page
E.F. Nijboer - 20 Jul '12 - 8:45
Sure, just update or append it to that div, something like: $('#div_id').append('Error: ' + e.Message.Message + ' ('+ e.Message.MessageCode +')');
kulasekaran-M - 20 Jul '12 - 9:24
Thanks a lot its working..

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 498
1 Arun Vasu 275
2 Maciej Los 273
3 Mahesh Bailwal 264
4 Aarti Meswania 175
0 Sergey Alexandrovich Kryukov 9,660
1 OriginalGriff 7,329
2 CPallini 3,968
3 Rohan Leuva 3,339
4 Maciej Los 2,851


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 20 Jul 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid