It all depends on the data that's returning.I believe the exception would certainly have some data/text that you can use to check if it is an exception and then conditionally update the appropriate div.
something like : $(document).ready(function() { $('.DOFFDelete').click(function() { var id = $(this).attr("id"); $.post("/Customer/DayOffDelete", { customerid: getCustomerId(), doffId: id }, function(data) { if ( data.matches('exception) ) $('#myExceptionDiv).html(data); else $("#myFormDOFF").html(data); }); }); }); Thanks & Regards, Dhruva Sagar. Charles de Gaulle<http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html> - "The better I get to know men, the more I find myself loving dogs." On Thu, Jul 23, 2009 at 11:27 AM, Kris-I <kris.i....@gmail.com> wrote: > > Hello, > > In my code (ASP.NET MVC using Nhibernate) , I do this : > > $(document).ready(function() { > $('.DOFFDelete').click(function() { > var id = $(this).attr("id"); > $.post("/Customer/DayOffDelete", { customerid: > getCustomerId(), doffId: id }, function(data) { > $("#myFormDOFF").html(data); > }); > }); > }); > > Then I display the result in the DIV named "myFormDOFF" > > Of course, my .NET code can generate exception. I'd like when I > receive an exception didn't change the content of "myFormDOFF" but > display the message send by the exception in another DIV. How can I do > this ? > > Thanks, >