<form id="form1" runat="server">
<div>
<input type="file" name="filUpload" id="filUpload" onchange="showimagepreview(this)" />
<img id="imgprvw" alt="uploaded image preview"/>
</div>
</form>
and script is
<script type="text/javascript">
function showimagepreview(input) {
alert();
if (input.files && input.files[0]) {
var filerdr = new FileReader();
filerdr.onload = function (e) {
$('#imgprvw').attr('src', e.target.result);
}
filerdr.readAsDataURL(input.files[0]);
}
}
</script>