<script type="text/javascript">
$(function() {
$('#<%=PhotoUpload.ClientID %>').change(function() {
var fileExtension = ['jpeg', 'jpg', 'png', 'gif', 'bmp'];
if ($.inArray($(this).val().split('.').pop().toLowerCase(), fileExtension) == -1) {
alert("Only '.jpeg','.jpg', '.png', '.gif', '.bmp' formats are allowed.");
}
})
})
</script>
but after displaying alert message when i click ok fileupload control takes that file please help me