I have a master detail screen In ASP.NET MVC, when I submit something, It instantly returns to me a grid with the inserted value via Ajax, my problem is: I want to pass a message of failure or successful via an jquery modal dialog or infobar and I can’t pass a viewdata for the jquery to process It.
Share
The action method that you are invoking through AJAX needs to return everything that’s needed in the response. So for example when you put some object inside ViewData, this object will be available inside the View (or probably the partial view) that you are returning from the action and so available to the calling javascript. Another option is to return JSON object containing the message:
which could be invoked like this: