Click here to Skip to main content
11,924,800 members (57,755 online)
Rate this:
Please Sign up or sign in to vote.
See more: Javascript jQuery MVC3
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");
                var grid = $("#grdHolidays").data("tGrid");
                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 1:38am
Edited 20-Jul-12 1:45am
Wes Aday104.2K

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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!
kulasekaran-M 20-Jul-12 8:20am
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:45am
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:24am
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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151125.3 | Last Updated 20 Jul 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100