I'm using the jQuery NotifyBar quite nicely in an Index view to display business rule errors when a user e.g. clicks a delete link for an item than cannot be deleted. However, if the user adds a new item, they are redirected to the Create view. If the new item is successfully created, the Create action redirects back to the Index view.
My quandary is that I need (have been told) to show a success notification in the above scenario. Previously, to request a notification while remaining on the same view, I was using return JavaScript()
for an action result, but when I use return RedirectAction()
for the action result, I'm left with nowhere to put the return JavaScript()
.
The way I see this is that I need to:
a) include information in the return RedirectAction()
that tells the 'destination' view to show the notification, or
b) invoke the notification in the 'source' view, instead of the return RedirectAction()
, and tell it that when it closes/is closed, to perform the redirect to the 'destination' view.
I have no idea where to begin deciding between these two opetions, nor how to even begin researching how to implement either. All advicem and pointers to advice will be most appreciated.