- Handle a particular Action method on the Controller side and save the related data/message via a custom ViewData key.
- Handle the GridViewSettings.CustomJSProperties event in the GridView's PartialView and check if a custom ViewData key exists. If so, store it as a custom JS Property.
- Handle the client-side ASPxClientGridView.EndCallback event and check if a custom JS Property exists. If so, visualize its value in the required manner and remove it.
Question Comments
Added By: venu koneru at: 4/21/2015 6:52:04 AM
@using ShowMessageAfterCallback.Controllers;
Please give us the code for the above controller
Added By: Vladimir (DevExpress Support) at: 4/21/2015 9:44:44 AMHello Venu,
This namespace is implemented in the HomeController.cs file. You can change a currently displayed file to see it. Alternatively, you can download the entire example, run it in our Example Runner and see its code.
settings.ClientSideEvents.EndCallback = "OnEndCallback"; where is this method implemented. Does this have to be in the client side java script.
Also can we access in the view razor template ViewData[HomeController.EditResultKey].ToString()
Please advise
Added By: Alessandro (DevExpress Support) at: 4/23/2015 1:06:54 AM Hi,Here are corresponding code snippets form the solution attached to this example:
Index.cshtml:
function OnEndCallback(s, e) { ...
GridViewPartial.cshtml:
if (ViewData[HomeController.EditResultKey] != null) { ...Added By: Howard Edidin at: 7/11/2016 12:38:44 PM I tried using the code in my MVC Grid
The issue is that this statement:
@Html.Action("GridViewPartialView")HttpServerUtility.Execute blocked while waiting for an asynchronous operation to complete. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Throws an exception
Exception Details: System.InvalidOperationException: HttpServerUtility.Execute blocked while waiting for an asynchronous operation to complete.
Source Error:
Line 13: Line 14: </script> Line 15: @Html.Action("GridViewPartialView") Line 16: Line 17: @Html.DevExpress().Label(lbl =>
If I replace it with @Html.Partial("GridViewPartialView", Model) I don't see the label
Added By: Nastya (DevExpress Support) at: 7/11/2016 11:37:42 PM
Hello,
I've created a separate ticket on your behalf (T402152: GridView - The T159638 example throws the "HttpServerUtility.Execute blocked while waiting for an asynchronous operation to complete" exception). It has been placed in our processing queue and will be answered shortly.