开发者

Changing the button of the ajaxtoolkit:AsyncFileUpload

I am using the ajaxtoolkit:AsyncFileUpload, and I was wondering if there is even a way to change the button that goes along with it?

<ajaxtoolkit:AsyncFileUpload Width="200" ID="filImageUpload" ThrobberID="imgUploadProgress" 
    OnUploadedComplete="filImageUpload_UploadComplete" 
    OnClientUploadComplete="filImageUpload_UploadImageComplete"   
    OnClientUploadStarted="filImageUpload_UploadStarted"
    OnClientUploadError="filImageUpload_UploadError" 
    UploaderStyle="Traditional" CompleteBackColor="LightGreen" ErrorBackColor="Red" runat="se开发者_运维技巧rver" />

Is there another attribute that will allow me to change it that I am missing? Or can I change it using CSS?

I know that when it renders I get and input element, but I don't know if I am able to change that text through that in CSS either.

Any help will be appreciated


Not a real fix, but by changing the UploaderStyle="Traditional" to UploaderStyle="Modern", you will be able to make the button an image instead. You can then add a CssClass to the AsyncFileUpload and add a background image through the style sheets.

.AFU
{
 position: relative;
 float: left;
 clear: both;
 top: 0px;
 padding-left: 0px;
 padding-right: 0px;
 width: 200px;
 border:thick;
 margin:0px;
 background: url("Your/Path/Here") no-repeat 100% 1px;
}


Just do that:

$("#AsyncFileUpload1").find('div').css('background', 'transparent');

$("#AsyncFileUpload1").find('div').css('background-image', 'url("Images/btnSelecionar.jpg")');

Replace AsyncFileUpload1 by your ControlId.

Works fine for me! =)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜