System.Web.UI.WebControls.FileUpload.HasFile Property

Gets a value indicating whether the System.Web.UI.WebControls.FileUpload control contains a file.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public bool HasFile { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The FileUpload.HasFile property gets a value indicating whether the System.Web.UI.WebControls.FileUpload control contains a file to upload. Use this property to verify that a file to upload exists before performing operations on the file. For example, before calling the FileUpload.SaveAs(string) method to save the file to disk, use the FileUpload.HasFile property to verify that the file exists. If FileUpload.HasFile returns true, call the FileUpload.SaveAs(string) method. If it returns false, display a message to the user indicating that the control does not contain a file.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0