Click here to Skip to main content
13,086,266 members (88,862 online)
Rate this:
Please Sign up or sign in to vote.
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 0:38am
Updated 20-Jul-12 0: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 |
Web04 | 2.8.170813.1 | Last Updated 20 Jul 2012
Copyright © CodeProject, 1999-2017
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