Validation Control (Upload file)

Results 1 to 2 of 2

Thread: Validation Control (Upload file)

  1. #1
    Join Date
    Dec 1969

    Default Validation Control (Upload file)

    Hi!I would like to do the validation control in uploading file.<BR>How do I ensure the user only need to upload at least 1 file<BR>before proceed?<BR><BR>&#060;asp:requiredfieldvalidator id="valFile" runat="server" display="dynamic" initialValue="" errorMessage="Please Upload File!" controlToValidate="fileAttachment"&#062;*&#060;/asp:requiredfieldvalidator&#062;<BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Validation Control (Upload file)

    You would need to use the CustomValidator instead. Then you would need to write your custom code for its ServerValidate event.<BR><BR> verValidateTopic.asp<BR><BR>The msdn docs have a good example. In your ServerValidate code, you would probably check Request.Files.Count to see that its &#062;1. If it is, set the validator as valid, else set it to invalid.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts