I have a Tooltip setup to display a grid of data when a span is clicked. The span has 'data' elements which contain the parameters to be passed to the Action method on the Controller. This all works pefertly fine in my development environment, however when I deploy to test or production the parameters being passed to the Action method are null.
My implementation follows this example:
https://demos.telerik.com/aspnet-mvc/tooltip/ajax#
When I try the demo at this link, it also does not display the content of the tooltip, just a blank tooltip.
So my question is why does this work for in my development environment but not my test or production environment? Also, does the example on the demo site not work?
My code is as follows:
.CSHTML content
This is partial content, but enough to show what is setup:
<h3>CMRP <span class="small" style="font-size: .5em">(Click on # for detail)</span></h3>
<div class="col-md-6 col-lg-6">
@{
string cmrpValidClass = item.CMRPValidCount == 0 ? "label-danger" : "label-success";
string cmrpValidTextClass = item.CMRPValidCount == 0 ? "text-danger": "text-success" ;
}
<span class="label cmrpDetail @cmrpValidClass" data-group="@item.Category~~true" data-validcmrp="true">@Html.DisplayFor(x => item.CMRPValidCount)</span>
<h5 class="@cmrpValidTextClass"> @Html.DisplayNameFor(x => x.CMRPValidCount) </h5>
</div>
<div class="col-md-6 col-lg-6">
@{
string cmrpNotValidClass = item.CMRPNotValidCount == 0 ? "label-success" : "label-danger";
string cmrpNotValidTextClass = item.CMRPNotValidCount == 0 ? "text-success" : "text-danger";
}
<span class="label cmrpDetail @cmrpNotValidClass" data-group="@item.Category~~false" data-validcmrp="false">@Html.DisplayFor(x => item.CMRPNotValidCount)</span>
<h5 class="@cmrpNotValidTextClass hasTooltip" title="@cmrpNotValid"> @Html.DisplayNameFor(x => x.CMRPNotValidCount) </h5>
</div>
</div>
</div>
}
</div>
@(Html.Kendo().Tooltip()
.For(".cmrpDetail")
.ShowOn(TooltipShowOnEvent.Click)
.LoadContentFrom("CMRPDetail", "CenterOfExcellence")
.Position(TooltipPosition.Top)
.Width(700)
.Height(500)
.Events(events =>
{
events.RequestStart("requestStart");
events.Show("show");
}))
function show() {
this.refresh();
}
function requestStart(e) {
e.options.data = {
id: e.target.data("group")
}
}
</script>
From CenterOfExcellenceController
public ActionResult CMRPDetail(string id)
{
string[] parameters = id.Split(new []{"~~"}, StringSplitOptions.None);
IEnumerable<CMRPDetailEntity> result = _mPractSkillsBo.GetCMRPDetailByGroup(parameters[0], bool.Parse(parameters[1]));
return PartialView("CMRPDetail", result);
}
The Routes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute("Default", "{controller}/{action}/{id}",
new {controller = "Home", action = "Index", id = UrlParameter.Optional}
);
routes.MapRoute(
"DeleteUser",
"{controller}/{action}/{id}/{guid}",
new {controller = "Account", action = "Delete"});
}