<FileUpload>

The FileUpload tag allows your users to upload a file to your web server. If a file has been upoaded, its filename is displayed.

Syntax

<FileUpload
    ID="string"
    DataField="string"
    DataType="string"
    DisplayMode="FilePicker|FilePickerNoUpload|UploadAndSelect"

    Extensions="comma-delimited list of extensions"
    FileNameLabelCssClass="string|Normal"
    MessageLabelCssClass="string|Normal"
    NewFileButtonCssClass="string|CommandButton"
    NewFileButtonText="string|Upload File"
    Nullable="True|False"
    Path="string"
    UploadButtonCssClass="string|CommandButton"
    UploadButtonText="string|Upload"
    UseUniqueFileName="True|False"

    Visible="True|False"
     /> 
 

Remarks

If your users need to upload files like images or documents to your web server, you can use the <fileupload> tag. If a file has been previously uploaded, the control displays the file's name. The user can click the "New File" button to show the HTML file upload control that allows them to browse to their file on their local machine. Once they've selected the file, they click the "Upload" button to begin the upload process. If the file's extension does not match those that have been specified in the "extensions" attribute or if there is some other error, it is displayed for the user. The "datatype" attribute is always string.

Validating the FileUpload Control: The nature of the FileUpload control does not allow it to be validated on the client. If you use a validator with this control, set the "enableclientscript" attribute to "false".

The FileUpload control has the following attributes:

NOTE: Because of Javascript's security mechanisms, the FileUpload control will NOT function if Partial Page Rendering has been enabled for the XMod Pro control. This is true of the ASP.NET FileUpload control and is not specific to XMod Pro's FileUpload control.

Back to top

Example

<addform>
  ...
  <table>
    <tr>
      <td>
        <label for="txtFirstName" text="First Name" />
        <textbox id="txtFirstName" datafield="FirstName" datatype="string" />
      </td>
    </tr>
    <tr>
      <td>
        <label for="txtLastName" text="Last Name" />
        <textbox id="txtLastName" datafield="LastName" datatype="string" />
       </td>
    </tr>
    <tr>
      <td>
        <label for="uplMugShot" text="Mug Shot" />
        <fileupload id="uplMugShot" path="~/images/" extensions="gif,jpg" datafield="UserImage" datatype="string" />
       </td>
    </tr>
    <tr>

      <td colspan="2">
        <addbutton text="Add"/>&nbsp;<cancelbutton text="Cancel"/>
      </td>
    </tr>
  </table>
</addform>
Back to top