2011-09-21 89 views
0

您好,使用RadToolTip即可。RadToolTip在使用自定义asp.net .ashx图像处理程序时未显示

<asp:Image ID="imgMain" runat="server"/> 
    <telerik:RadToolTip ID="RadToolTip2" runat="server" TargetControlID="imgMain" Width="400px" RelativeTo="Element" EnableShadow="true" Position="BottomCenter" Animation="Slide"   AnimationDuration="300" ShowDelay="200" Skin="Vista" HideEvent="LeaveToolTip"> 
    </telerik:RadToolTip> 

林还增加了在运行时RadToolTip内部的图像,该图像的imageURL表示通过使用该站点内和工程罚款我自己的自定义图像处理程序设置。

当用户将鼠标悬停在'imgMain'上时,RadToolTip应显示相同的图像,但大小不同,但所有即时消息都显示为标题的RadToolTip。 如果我将图片网址硬编码到RadToolTip里面的图像中,显示的很好,所以我知道它对我的ImageHandler没有问题。

从RadToolTip中的图像处理程序动态显示图像是否存在任何已知问题?

我的服务器端代码低于

imgMain.ImageUrl = String.Format("~/dbimagehandler.ashx?record=product&empty=showt&imageno=1&recno=-1&wid={0}&hgt={1}&productid={2}", "188", "196", this.ProductId) 

imgMain.AlternateText = ds.Ds.Tables["Table"].Rows[0]["Title"].ToString(); 
imgMain.ToolTip = ds.Ds.Tables["Table"].Rows[0]["Title"].ToString(); 

RadToolTip2.TargetControlID = imgMain.ID; 
Image imgsmall = new Image(); 
imgsmall.ImageUrl = String.Format("~/dbimagehandler.ashx?record=product&empty=showt&imageno=1amprecno=-1&wid={0}&hgt={1}&productid={2}", "376","392", this.ProductId); 
RadToolTip2.Controls.Add(imgsmall); 

任何帮助,在此将大大apreciated。

回答

0

将影像添加到tooltip在哪些事件?如果它在AJAX请求中,请确保工具提示也已更新。您也可以检查网络标签,看看您的图片请求是否实际返回图片而不是404,这将是缺失图片的一个很好的理由。

您也可以尝试在标记中放置图像,并仅从服务器或甚至通过客户端上的JavaScript(例如在OnClientShow事件中,通过将URL存储在隐藏字段中)设置其URL。

您还可以看看RadToolTipManager提供的按需加载,例如形成telerik演示网站,例如here,因为它非常适合您动态创建图像的方式。

+0

我在页面加载事件中添加图像。我已经通过手动导航到.ashx页面检查了图像处理程序正在处理的图像。我也使用Firbug来检查RadToolTip,并且图像在那里,当我在它上面时,它显示了萤火虫中的图像,但RadTooilTip仍然显示为:无。 –

0

不知道,如果你已经在这样做,但要确保你已经在你的身后以下代码样的代码(我使用C#)

private void LoadTree() 
{ 
     RadToolTipManager1.ShowDelay = 100; 
     RadToolTipManager1.HideDelay = 100; 
     RadToolTipManager1.AutoCloseDelay = 8000; 
     RadToolTipManager1.TargetControls.Add("<ID Of the Control where you wish to diplay the rad tool tip>"); 
} 
相关问题