Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader and RequiredField Validator Options
cj
Posted: Wednesday, July 16, 2008 8:10:08 AM
Rank: Newbie
Groups: Member

Joined: 7/15/2008
Posts: 2
Hi!

How do I check to make sure that a user uploads a file before the rest of the page is submitted?

I have a form that collects a users' name, the date, and so on. Before the user can press the submit button, want to make sure the user has uploaded a file.

Thanks.
eo_support
Posted: Wednesday, July 16, 2008 8:22:19 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

I believe the latest version supports RequiredFieldValidator. You would just set its ControlToValidate to the uploader. Previous version does not support this, but it has just been added to our latest version that is available on our download page.

Thanks
Trick
Posted: Wednesday, July 16, 2008 8:42:53 AM
Rank: Member
Groups: Member

Joined: 8/9/2007
Posts: 18
Hi CJ/EO,

To confirm, I've just tested this and it works like a dream (version 6.0.18.2 / Web Controls 2008).

Regards,

Richard.
eo_support
Posted: Wednesday, July 16, 2008 8:58:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Excellent. Thanks for the update!
cj
Posted: Thursday, July 17, 2008 4:44:04 AM
Rank: Newbie
Groups: Member

Joined: 7/15/2008
Posts: 2
Hi eo_support,

1. I am dynamically creating the upload control on page load and placing it in a PlaceHolder control and therefore the RequiredFieldValidator cannot find a control to validate. unless you have a better solution.

2. I created the event handler below by double clicking on the upload control but it gives me this error:

Handles clause requires a WithEvents variable defined in the containing type or one of its base types.


Protected Sub AJAXUploader5_FileUploaded(ByVal sender As Object, ByVal e As System.EventArgs) Handles AJAXUploader5.FileUploaded

End Sub


Is there a better way to create an event handler for the upload control?

Thanks.

CJ
eo_support
Posted: Thursday, July 17, 2008 7:15:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi CJ,

For your questions:

1. I believe you will be able to set the RequiredFieldValidator.ControlToValidate with code;

2. Instead of do "AJAXUploader5 As EO.Web.AJAXUploader", you will do "WithEvents AJAXUploader5 As EO.Web.AJAXUploader";

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.