Controls You Can Use on Web Forms ASP.NET Standard Controls FileUpload Control
To use a FileUpload Web server control, you add it to a page and then add controls and static text to it.
- Declare an <
asp:FileUpload
> element on the page. For syntax, see FileUpload Control Syntax.
- Optionally set the following properties of the FileUpload control to specify how the fileupload interacts with its child controls.
Property |
Description |
HorizontalAlign |
Specifies how the child controls are aligned within the fileupload ( left , right , center , or justified ). |
Wrap |
Specifies whether content that is too wide for the fileupload is wrapped to the next line or truncated at the fileupload’s edge. |
- Optionally set the FileUpload's style attributes to create a distinct appearance for the group of controls within the fileupload.
<asp:FileUpload id="myFileUpload" backcolor="wheat" width=300
borderstyle="ridge" borderwidth=1 runat="server">
The following example shows how you can dynamically add controls to a FileUpload control at run time.
For details about adding controls to a container control such as a FileUpload, see Adding Controls to a Web Forms Page Programmatically.
Introduction to the FileUpload Control