更改 AsyncFileUpload 控件上的按钮文本

发布于 2024-10-13 00:38:41 字数 122 浏览 14 评论 0原文

是否可以将 Ajax 控件工具包的 AsyncFileUpload 控件上的按钮文本从“选择文件”(现代风格)更改为其他内容?它应该是一个简单的东西,比如按钮上的文本属性,但我找不到任何属性。还可以为按钮应用任何其他自定义样式吗?

is it possible to change the button text on the Ajax control toolkit's AsyncFileUpload control from "Select File" (modern style) to something else? it should be a simple thing like Text property on Button, but I can't find any property for this. also is it possible to apply any other custom styles for the button?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

べ映画 2024-10-20 00:38:41

下载 Ajax Toolkit 源代码并在其中进行样式调整。重新编译项目并使用新的 DLL。这些控件往往将样式嵌入为 Web 资源,这会覆盖您可能尝试应用的 CSS。

Download the Ajax Toolkit source code and make the styling adjustments there. Recompile the project and use the new DLL. The controls tend to have styling embedded as web resources, which override the CSS you may try to apply.

温柔戏命师 2024-10-20 00:38:41

还有另一种方式

<div class="inputblock" style="width: 350px;">
 <ajaxToolkit:AsyncFileUpload runat="server" ID="FileUP" ClientIDMode="AutoID" UploaderStyle="Modern" OnUploadedComplete="FileUP_UploadedComplete" Width="100%" />
</div>

可以呈现类似这样的内容

<div id="ctl00_PopUpPlaceHolder_FileUP">
<input name="ctl00$PopUpPlaceHolder$FileUP$ctl00" id="ctl00_PopUpPlaceHolder_FileUP_ctl00" type="hidden">
<div id="ctl00_PopUpPlaceHolder_FileUP_ctl01" style='background: url("/WebResource.axd?d=some&pars") no-repeat 100% 1px; margin: 0px; width: 100% !important; height: 24px; text-align: right; min-width: 100%;'>
    <input name="ctl00$PopUpPlaceHolder$FileUP$ctl02" id="ctl00_PopUpPlaceHolder_FileUP_ctl02" style="width: 100%; font-size: 14px; opacity: 0; -moz-opacity: 0.0;" type="file">
    <div style="text-align: left; margin-top: -23px;" type="text">
        <input name="ctl00$PopUpPlaceHolder$FileUP$ctl04" id="ctl00_PopUpPlaceHolder_FileUP_ctl04" style="width: 248px; height: 17px; font-family: Tahoma; font-size: 12px;" type="text" readonly="readonly">
    </div>
</div>

,您总是可以更改 css 来更改这样的任何样式:

#ctl00_PopUpPlaceHolder_FileUP_ctl01 {
    background:  url("/img/input_file.png") no-repeat right top !important;
    //some othe stylings, but "!important" is strongly necessarily
}

这有效。

there is another one way

<div class="inputblock" style="width: 350px;">
 <ajaxToolkit:AsyncFileUpload runat="server" ID="FileUP" ClientIDMode="AutoID" UploaderStyle="Modern" OnUploadedComplete="FileUP_UploadedComplete" Width="100%" />
</div>

these renders something like this

<div id="ctl00_PopUpPlaceHolder_FileUP">
<input name="ctl00$PopUpPlaceHolder$FileUP$ctl00" id="ctl00_PopUpPlaceHolder_FileUP_ctl00" type="hidden">
<div id="ctl00_PopUpPlaceHolder_FileUP_ctl01" style='background: url("/WebResource.axd?d=some&pars") no-repeat 100% 1px; margin: 0px; width: 100% !important; height: 24px; text-align: right; min-width: 100%;'>
    <input name="ctl00$PopUpPlaceHolder$FileUP$ctl02" id="ctl00_PopUpPlaceHolder_FileUP_ctl02" style="width: 100%; font-size: 14px; opacity: 0; -moz-opacity: 0.0;" type="file">
    <div style="text-align: left; margin-top: -23px;" type="text">
        <input name="ctl00$PopUpPlaceHolder$FileUP$ctl04" id="ctl00_PopUpPlaceHolder_FileUP_ctl04" style="width: 248px; height: 17px; font-family: Tahoma; font-size: 12px;" type="text" readonly="readonly">
    </div>
</div>

and you always may change th css to change any syling like this:

#ctl00_PopUpPlaceHolder_FileUP_ctl01 {
    background:  url("/img/input_file.png") no-repeat right top !important;
    //some othe stylings, but "!important" is strongly necessarily
}

this works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文