.aspx
function checkFileExtension(objSource, objArgs) {
var blnValid;
var file = objArgs.Value.split(".");
var extn = file[file.length - 1].toUpperCase();
if (extn == "MOV" || extn== "WMV") {
blnValid = true;
}
else {
blnValid = false;
}
objArgs.IsValid = blnValid;
return;
}
asp:CustomValidator ID="CustomValidator1" ValidationGroup="News" runat="server"
ClientValidationFunction="checkFileExtension" ControlToValidate="flImage" Display="None"
ValidateEmptyText="false" ErrorMessage="Only .mov,.wmv video files are allowed." asp:CustomValidator
No comments:
Post a Comment