Skip to content

DevExpress-Examples/asp-net-web-forms-upload-control-custom-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Upload Control for ASP.NET Web Forms - How to implement custom validation rules

This example demonstrates how to display an error icon if no file is selected.

Error Icon

Overview

The main idea is to call the upload control's client-side GetText method to get the selected file's name. If no file is selected, the upload control displays an error icon.

function OnClick(s, e) {
    var isValid = uploadControl.GetText() != "";
    img.SetVisible(!isValid);
    if (isValid)
        uploadControl.Upload();
}
<dx:ASPxUploadControl ID="upload" runat="server" ClientInstanceName="uploadControl" ... />

<dx:ASPxImage ID="imgErrorIcon" runat="server" ClientInstanceName="img" ClientVisible="False" />

<dx:ASPxButton ID="btnCheck" runat="server" AutoPostBack="false" >
    <ClientSideEvents Click="OnClick" />
</dx:ASPxButton>

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Display an error icon if no file is selected.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •