This is a migrated thread and some comments may be shown as answers.

Web Service "context" parameter - explain?

2 Answers 86 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Sime
Top achievements
Rank 1
Sime asked on 22 Jun 2011, 02:51 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 23 Jun 2011, 11:04 AM
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.

0
Sime
Top achievements
Rank 1
answered on 23 Jun 2011, 01:26 PM
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.

Tags
ToolTip
Asked by
Sime
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Sime
Top achievements
Rank 1
Share this question
or