I have one problematic question on custom validator at client side in asp.net?
This is my fileupload control and customvalidator to check that uploaded file is doc or not!!!!
<asp:FileUpload Id="fu_1" runat="server" />
asp:CustomValidator ID="cv_fu1" runat="server" ControlToValidate="fu_1" ValidationGroup="submit" ClientValidationFunction="file_upload" text="Pls!!! uploat doc file only"> </asp:CustomValidator>
This is my javascript function for checking that upload file is doc or not!!!!!!
function file_upload()
{
var file1 = document.getElementById("fu_1").value;
len_file1 = file1.length;
var len1_name = file1.substring(len_file1 - 3,len_file1);
if(len1_name != 'doc')
{
alert("wrong file format");
}
}
i want to put error message in custom validator in place of alert message..of javascript..
like other validator's error message.. i put error in text property of validator above..pls check it in custom validator property.. that error i want to show...
i check all question related to this .. but i cant find that i want..