How could I add a toolti开发者_Python百科p to a ext:FileUploadField
control? I tried to assign a ToolTip for my Browse button like the below, but it's not working.
<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>
You can set Target="#{FileUpload1}-file"
on the <extTooltip>
.
The following example demonstrates the full scenario.
Example
<%@ 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>
Wrapping the string FileUpload1
with #{}
will ensure the client-side .ID (.ClientID) is used to reference the correct instance of the <ext:FieldUploadField>
object.
Hope this helps.
精彩评论