I have an mvc application with telerik grid.
Inside telerik gird i have one column template field where i want to use actionlink.
In the action link I want to pass (RouteValueDictionary)ViewBag.GridState and confirm message dialog.
How can i do this?
It is giving error if i am using it with (RouteValueDictionary)ViewBag.GridState
Instead of new { onclick = "return confirm('Are you sure?');" }) if i pass null then it works but i want confirm dialog before it go to control action method.
This is the code what i am trying.
columns.Template(
@
@{ ViewBag.GridState["id"] = @item.BATCHID;
ViewBag.GridState["CurrentView"] = "Index";
ViewBag.GridState["fromPeriod"] = Model.FromPeriod;
ViewBag.GridState["toPeriod"] = Model.ToPeriod;
}
@Html.ActionLink("Set Poster", "SetPosterBy","Batch",(RouteValueDictionary)ViewBag.GridState, new { onclick = "return confirm('Are you sure?');" })
).Width(200).Title("SET POSTED/CLOSED/QAED BY");
Please help.

Deepika ChaudharyPosted Dec 18, 2013, 12:31 AM
@Html.ActionLink("Set Poster", "SetPosterBy", "batch",(RouteValueDictionary)ViewBag.GridState, new RouteValueDictionary(new { onclick = "return confirm('Are you sure you want to set coded for this batch?')" }));
we have to use html attribute also as routevaluedictionary.
I tested this, and it works perfectly.
Hope it will help someone.
Deepika ChaudharyPosted Jul 26, 2013, 7:41 AM
Iftikar HussainPosted Jul 26, 2013, 7:33 AM
http://stackoverflow.com/questions/4682107/asp-net-mvc-delete-actionlink-with-confirm
http://pastebin.com/aZxzZYfS
Regards,
Iftikar
Deepika ChaudharyPosted Jul 26, 2013, 7:29 AM
Iftikar HussainPosted Jul 26, 2013, 7:23 AM
Try like this without routeValues
Regards,
Iftikar