Giter Site home page Giter Site logo

devexpress-examples / aspxuploadcontrol-how-to-implement-a-custom-required-field-required-validation-e3908 Goto Github PK

View Code? Open in Web Editor NEW
0.0 55.0 1.0 36 KB

Display an error icon if no file is selected.

License: Other

C# 6.92% ASP.NET 83.93% Visual Basic .NET 9.16%
dotnet multi-purpose-controls asp-net upload validation

aspxuploadcontrol-how-to-implement-a-custom-required-field-required-validation-e3908's Introduction

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

aspxuploadcontrol-how-to-implement-a-custom-required-field-required-validation-e3908's People

Contributors

devexpressexamplebot avatar elenapeskova avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

elenapeskova

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.