Hi,
I am checking for invalid extensions using following syntax:
<asp:CustomValidator runat="server" ID="CustomValidatorForRadUpload" Display="None" ClientValidationFunction="ValidateFileExtensions">Invalid extensions.</asp:CustomValidator>
<telerik:RadUpload Width="100%" ID="radMultipleFileUpload" InitialFileInputsCount="1"
Skin="Gray" runat="server" OnClientFileSelected="fnClicked" OnClientDeleting="fnCheckInputRowsExists"
AllowedFileExtensions=".jpg,.jpeg,.gif,.png" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
</telerik:RadUpload>
Javascript function is as follows:
function ValidateFileExtensions(source, arguments)
{
var blnIsValid;
blnIsValid = $find("<%= radMultipleFileUpload.ClientID %>").validateExtensions();
if (!blnIsValid)
{
alert("Please upload images with jpg, jpeg, gif, or png extensions.")
return false;
}
return true;
}
1) Here after this function gets called and if user have selected invalide file extensions then.
function returns false.
But still page gets postback which i dont want to happen.
2) Also I dont want any message to be displayed on the radupload area. How can I prevent that.
Please reply.