CustomValidator control that checks if the directory path exists

peter10

New member
Joined
Jun 9, 2003
Messages
2
Hi,
I have a CustomValidator control that checks if the directory path a user enters actually exists. Functions correctly on my web servers browser but if I access the site on a different machine then the validation always fails. Any ideas on why this is occurring?

Heres the function:
Private Sub BuildLocationValidator_ServerValidate(ByVal source As System.Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles BuildLocationValidator.ServerValidate
If Not (Directory.Exists(txtBuildLocation.Text)) Then
BuildLocationValidator.IsValid = False
args.IsValid = False
lbFailedUpload.Visible = True
lbFailedUpload.Text = "Build Location is Invalid."
Else
BuildLocationValidator.IsValid = True
args.IsValid = True
End If
End Sub

Peter
 
That might be because its checking for the directory on your web server, not the clients computer.
 
No, its always checking for a directory on a different server and uses the full UNC path to the directory.
 
Back
Top