Hi,Here is File size validation code. But it doesn't checking validation.
<script type="text/javascript">
function UploadFile(fileUpload) {
if (fileUpload.value != '') {
var uploadControl=document.getElementById("<%=btnUpload.ClientID %>").click();
} if (uploadControl.files[0].size > 1024) {
document.getElementById('lblMsg').style.display = "block";
return false;
}
else {
document.getElementById('lblMsg').style.display = "none";
return true;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="FileUpload1" ErrorMessage="RegularExpressionValidator" ValidationExpression="\.pdf|\.doc"></asp:RegularExpressionValidator><br />
<asp:Label ID="lblMsg" runat="server" Text="File uploaded successfully." ForeColor="Green"Visible="false" />
<asp:Button ID="btnUpload" Text="Upload" runat="server" OnClick="Upload" Style="display: none" />
</form>
</body>
</html>
Feel free to share informations