我正在使用以下教程更改默认文件上传控件的 CSS链接
我设法为一个控件实现它但我需要它为同一页面上的四个文件上传控件工作。
问题是它只为一个控件实现这个。
// For Custom FileUpload
$("input[type=file]").filestyle({
image: '<%= ResolveUrl ("~/images/browse.png") %>',
imageheight: 22,
imagewidth: 82,
width: 128
});
我将它更改为适用于 Class 它仍然只为第一个控件实现
$(".fileUpload").filestyle({
image: '<%= ResolveUrl ("~/images/browse.png") %>',
imageheight: 22,
imagewidth: 82,
width: 128
});
HTML 代码示例
<div class="row-form">
<div class="row-lbl-wrapper"> <span class="row-req">*</span>
<asp:Label ID="Label1" runat="server" CssClass="row-label" Text="CV:"></asp:Label>
</div>
<div class="file-upload-wrapper">
<asp:FileUpload ID="FileUpload1" runat="server" CssClass="fileUpload" />
<asp:Button ID="btnUploadCV" runat="server" Text="Upload" CssClass="btn-upload" onclick="btnUploadCV_Click" ValidationGroup="Careers" />
<asp:Button ID="btnProcessData" runat="server" Text="Process Data" OnClick="btnProcessData_Click" Visible="False" />
<asp:Label ID="lblImageMSG" runat="server" Text=""></asp:Label>
</div>
<div class="tooltip tooltip-override" title="Allowed file formats are .pdf, .doc and .docx.">
<asp:Image ID="Image2" CssClass="tooltip-img" runat="server" ImageUrl="~/images/tooltipgreen.png" />
</div>
<asp:RequiredFieldValidator ID="rfvF1" runat="server" ValidationGroup="Careers" ErrorMessage="*" CssClass="row-validate" ControlToValidate="FileUpload1"></asp:RequiredFieldValidator>
</div>
<div class="row-form">
<div class="row-lbl-wrapper"> <span class="row-req">*</span>
<asp:Label ID="Label2" runat="server" CssClass="row-label" Text="CV:"></asp:Label>
</div>
<div class="file-upload-wrapper">
<asp:FileUpload ID="FileUpload2" runat="server" CssClass="fileUpload" />
<asp:Button ID="Button1" runat="server" Text="Upload" CssClass="btn-upload" onclick="btnUploadCV_Click" ValidationGroup="Careers" />
<asp:Button ID="Button2" runat="server" Text="Process Data" OnClick="btnProcessData_Click" Visible="False" />
<asp:Label ID="Label3" runat="server" Text=""></asp:Label>
</div>
<div class="tooltip tooltip-override" title="Allowed file formats are .pdf, .doc and .docx.">
<asp:Image ID="Image3" CssClass="tooltip-img" runat="server" ImageUrl="~/images/tooltipgreen.png" />
</div>
</div>
我们不能更改它以更改所有文件上传控件的样式。示例它的外观