Thanks!
RadTooltipManager
<
rad:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" Width="250" Height="350" runat="server" Position="MiddleRight" Sticky="true" Skin="Web20">
<WebServiceSettings Path="../ToolTip.asmx" Method="SbuDetailHtml" />
</
rad:RadToolTipManager>
onMouseOver
<
a href="#" runat="server" id="hyp" onmouseover="ShowSBUToolTip(this)" sbuid="104">RPTT Detail</a>
Javascript
function
ShowSBUToolTip(element) {
var tooltipManager = $find("mgr_gwpctGrid_ctGrid_RadToolTipManager1");
var sbuid = element.getAttribute("sbuid");
//If the user hovers the image before the page has loaded, there is no manager created
if (!tooltipManager) return;
//Find the tooltip for this element if it has been created
var tooltip = tooltipManager.getToolTipByElement(element);
//Create a tooltip if no tooltip exists for such element
if (!tooltip) {
tooltip = tooltipManager.createToolTip(element);
tooltip.set_value(sbuid);
}
//Let the tooltip's own show mechanism take over from here - execute the onmouseover just once
element.onmouseover =
null;
//show the tooltip
tooltip.show();
}
Web Service Method
[
WebMethod]
public String SbuDetailHtml(object context)
{
IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context;
string sbuid = ((string)contextDictionary["Value"]);
String _rtnStr = String.Empty;
String _urlStr = String.Format("http://localhost:8082/portfolio/sbudetail.aspx?id={0}", sbuid);
HttpWebRequest _request = (HttpWebRequest)WebRequest.Create(_urlStr);
Char[] _read = new Char[256];
_request.Credentials = System.Net.
CredentialCache.DefaultNetworkCredentials;
_request.PreAuthenticate =
true;
_request.UserAgent = _request.UserAgent;
HttpWebResponse _response = (HttpWebResponse)_request.GetResponse();
Stream resStream = _response.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
StreamReader readStream = new StreamReader(resStream, encode, true, 2000);
Int32 count = readStream.Read(_read, 0,_read.Length);
String str = Server.HtmlEncode(" ");
while (count > 0)
{
// Dumps the 256 characters on a string and displays the string to the console.
String strRead = new String(_read, 0, count);
str = str.Replace(str, str + Server.HtmlEncode(strRead.ToString()));
count = readStream.Read(_read, 0, 256);
}
// return what was found
_rtnStr = str.ToString();
resStream.Close();
readStream.Close();
return _rtnStr;
}
Tooltip panel does not render html, but simply displays the string...