ToolTip for FileUploadField Ext.NET控件

时间:2011-06-28 10:04:09

标签: asp.net ext.net

如何向ext:FileUploadField控件添加工具提示?我尝试为我的“浏览”按钮分配一个工具提示,如下所示,但它无效。

<ext:FileUploadField ID="FileUpload1" runat="server" Icon="BrowsePicture" ButtonText="" ButtonOnly="true" AutoPostBack="true">
    <ToolTips>
        <ext:ToolTip runat="server" ID="FileUpload1_TT" Title="Browse" Html="Browse"></ext:ToolTip>
    </ToolTips>
    <Listeners>
        <FileSelected Fn="showFile" />
    </Listeners>
</ext:FileUploadField>

1 个答案:

答案 0 :(得分:0)

您可以在Target="#{FileUpload1}-file"上设置<extTooltip>

以下示例演示了完整方案。

示例

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Ext.NET Example</title>
</head>
<body>
    <ext:ResourceManager runat="server" />

    <form runat="server">
        <ext:FileUploadField ID="FileUpload1" runat="server" ButtonOnly="true" ButtonText="Select">
            <ToolTips>
                <ext:ToolTip runat="server" Title="Browse" Html="Browse" Target="FileUpload1-file" />
            </ToolTips>
        </ext:FileUploadField>
    </form>
</body>
</html>

使用FileUpload1包装字符串#{}将确保客户端.ID(.ClientID)用于引用<ext:FieldUploadField>对象的正确实例。

希望这有帮助。