Change button text in AsyncFileUpload control

Is it possible to change the button text in the Ajax Toolkit AsyncFileUpload control from "Select File" (modern style) to something else? it should be a simple thing, such as the Text property on Button, but I cannot find any property for this. can also apply any other custom styles for the button?

+4
source share
2 answers

Download the Ajax Toolkit source code and make style adjustments. Recompile the project and use the new DLL. Controls typically have a style embedded in web resources that override CSS that you can try to apply.

0
source

there is another way

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

it does 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 can always change sss to change any silling as follows:

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

it works.

0
source

Source: https://habr.com/ru/post/1336186/


All Articles