Web Service "context" parameter - explain?

3 posts, 1 answers
  1. Sime
    Sime avatar
    24 posts
    Member since:
    Jul 2007

    Posted 22 Jun 2011 Link to this post

    Hi,

    I see that the call to the web service passes a context parameter with a "TargetControlID" and "Value" keys.

    I can see that TargetControlID is set to the id of the target control, but what is the "Value" parameter and how do I set its value so I can use it to pass information?

    NB: Although you have 2 examples on your website of using a web service to display tooltips, I cannot see this information. The code for the actual web services is not shown. Also I can't see anything relating to using the web service option in the documentation! Perhaps this needs updating?
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 23 Jun 2011 Link to this post

    Hello Sime,

    The Value property is a string that the ToolTip can hold and it is useful for passing information that is necessary to the application logic down to the user control that is loaded in the tooltip, for example. You can see it in action in the following demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx. Please examine the RadGrid1_ItemDataBound method where the Value is set to the ProductID of the target control (in the ToolTIpManager's Add method) and then the UpdateToolTip method where this information is passed to the user control for its databinding.

    When you install the Telerik RadControls for ASP.NET AJAX you also get the Live Demos installed locally (in the Live Demos folder in your installation directory) so you can inspect and modify their code freely. The webservice code is there as well in the App_Code folder, the ToolTipWebService.cs file.

    The way to use a webservice is shown in the demos while the actual webservice is not shown since it is a custom function that is not relevant to the RadToolTipManager.

    As for the documentation - it is indeed a little outdated and we are currently in the process of updating it, but I cannot provide a firm estimate as to when this task will be completed.


    Greetings,
    Marin
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sime
    Sime avatar
    24 posts
    Member since:
    Jul 2007

    Posted 23 Jun 2011 Link to this post

    Aha! Thanks Marin,

    So I see from the code that I can specify the Value parameter when I add a target control to the TargetControls collection.

    e.g.:

    RadToolTipManager.TargetControls.Add(New Telerik.Web.UI.ToolTipTargetControl(id, "Value", True))


    Very, very useful, thank you!

    Yes, I thought the code would be available in the downloads somewhere - but its very hard to find the time to sift through it when you're busy! It would be great to have some mention of the web service option in the documentation as its such a useful option performance wise - much better, in my view, than the AjaxUpdate method.

Back to Top