Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I change the file upload browse button width and styles such as background colors etc? I have already reviewed the answers provided alternative using jquery controls or other html forms techniques. I just need to do change in the file upload server side control in aspx page.

Thanks
Posted
Updated 27-May-16 8:31am
v3

Just apply the style as per need. Define a css class and set the control property CssClass.

Something similar to:
Styling an input type="file"[^]
Style File upload control in ASP / HTML[^]
 
Share this answer
 
Comments
sajid zafar_Iqbal 8-May-13 11:11am    
have already reviwed these articles but in case
y style="margin: 0px">
<form id="fileUpload" method="post" enctype="multipart/form-data" runat="server">
<div>


<asp:FileUpload ID="filFile" runat="server" Width="300" />

what changes i will make here to get rid out of that issue which i have mentioned above i have a form runat = "server" and i want to do changing here
Sandeep Mewara 8-May-13 11:32am    
If you see page 'ViewSource', you will find that fileupload controls are input tags internally.

Tried: <asp:FileUpload ID="testFileUpload" runat="server" CssClass="myStyle" />
Not sure what is troubling you. If you are asking on how to style it at runtime...
testFileUpload.CssClass = "myStyle";
Please go through the below articles to know about the methods to apply css on input type file.

1. File Style Plugin for jQuery[^].
2. Styling an input type="file"[^].
3. STYLING FILE INPUTS WITH CSS AND THE DOM[^].

Thanks...
 
Share this answer
 
Comments
sajid zafar_Iqbal 8-May-13 11:10am    
have already reviwed these articles but in case
y style="margin: 0px">
<form id="fileUpload" method="post" enctype="multipart/form-data" runat="server">
<div>


<asp:FileUpload ID="filFile" runat="server" Width="300" />

what changes i will make here to get rid out of that issue which i have mentioned above i have a form runat = "server" and i want to do changing here
Could not get you... Which issue are you talking about ?
your server side control renders as input type file on which you can apply style using this method

STYLING FILE INPUTS WITH CSS AND THE DOM[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900