Kendo tooltip loading content with AJAX not showing content

3 posts, 1 answers
  1. Huy
    Huy avatar
    12 posts
    Member since:
    Jun 2012

    Posted 04 Nov 2014 Link to this post

    I tried to implement a tooltip on this Telerik site :

    This is my script code on cshtml page:

    .Filter("td a")
    .LoadContentFrom("ToolTipCustomer", "Home")
    .Events(events => events.RequestStart("requestStart"))

    Event requestStart:

    function requestStart(e) { = {

    And controller:

    public ActionResult ToolTipCustomer(int id)
            Customers objCustomer = new Customers();
            DaCustomers db = new DaCustomers();
            objCustomer = db.GetCustomerById(id);
            StringBuilder str=new StringBuilder();
            str.Append("<div style='text-align:left;'>");
            str.Append("<p>" + objCustomer.Name + "</p>");
            str.Append("<p>Address: " + objCustomer.Address + "</p>");
            str.Append("<p>Telephone: " + objCustomer.Phone + "</p>");
            str.Append("<p>Email: " + objCustomer.Email + "</p>");
            return PartialView();

    And result is: when i hover tag a, tooltip not showing any content, when i debug, method TooltipCustomer get parameter "id" and return StringBuilder exactly, don't know where i am going wrong, please help me.
  2. Answer
    Dimo avatar
    8486 posts

    Posted 06 Nov 2014 Link to this post

    Hello Huy,

    Are you actually using the ViewBag.Title value in the partial view markup? You have to render it somewhere in the code of the View, as it will not be served to the client automatically.

    Our "Loading content with AJAX" example uses a ajax_details.cshtml partial view, which you can see in the offline ASP.NET MVC demo site, which is shipped in the UI for ASP.NET MVC installation. The partial view code looks like this:

    <div class="dairy-details">   
        <img src="@Url.Content("~/content/web/foods/200/")@(" alt="@ViewBag.Title" />

    In case you are not familiar with ViewBag and how it works, I recommend you to get to know it, as it will be useful for your general ASP.NET MVC knowledge.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Huy
    Huy avatar
    12 posts
    Member since:
    Jun 2012

    Posted 06 Nov 2014 in reply to Dimo Link to this post

    Hi Dimo,

    Thank you for your reply, i'm a new in Kendo and MVC so i try to learn it but your demo site about kendo tooltip have not in partial view, that is really difficult to me.

Back to Top