In the file upload after uploading the image I need to show immediately that image in the another division which is available in same page without refreshing full page I used location.reload()
but that is reloading full page.
Asked
Active
Viewed 113 times
0

Ashkan Mobayen Khiabani
- 33,575
- 33
- 102
- 171

nazar tvm
- 99
- 7
-
possible duplicate of [jQuery add image inside of div tag](http://stackoverflow.com/questions/941206/jquery-add-image-inside-of-div-tag) – Dhaval Apr 22 '15 at 05:19
-
$("#theDiv").append("
"); – Dhaval Apr 22 '15 at 05:19
-
Possible duplicate of this -http://stackoverflow.com/questions/16207575/how-to-preview-a-image-before-and-after-upload – Jalpesh Vadgama Apr 22 '15 at 05:30
-
by using ajax request i am sending image to server its saving in the database but it is not showing in the division until i reload my page – nazar tvm Apr 22 '15 at 05:36
-
you are using Asp Upload or ajax Uploader ? – sudhansu63 Apr 22 '15 at 05:41
-
i am using ordinary html file upload – nazar tvm Apr 22 '15 at 05:43
2 Answers
0
You could use ajax and you can load a portion of the page.
Check it out

Arun Bertil
- 4,598
- 4
- 33
- 59
-
by using ajax request i am sending image to server its saving in the database but it is not showing in the division until i reload my page – nazar tvm Apr 22 '15 at 05:36
0
You can see similar question related to it.
<script type="text/javascript">
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
</script>
<body>
<form id="form1" runat="server">
<input type='file' onchange="readURL(this);" />
<img id="blah" src="#" alt="your image" />
</form>
</body>

Community
- 1
- 1

Jalpesh Vadgama
- 13,653
- 19
- 72
- 94
-
by using ajax request i am sending image to server its saving in the database but it is not showing in the division until i reload my page – nazar tvm Apr 22 '15 at 05:36
-
You need to make a ajax call of server to get URL from server via jquery and then it will show. – Jalpesh Vadgama Apr 22 '15 at 05:38
-
do u have any idea about loading division only without loading whole page – nazar tvm Apr 22 '15 at 05:50
-
Put a devision with image tag and then get a url from ajax call of server and then put that url in division via code above. I think this should slove your problem. – Jalpesh Vadgama Apr 22 '15 at 05:52
-
but my url is looking like this http://localhost:14605/Home.aspx?id=mELirpUhRYksFj7k8%2fXBcQ%3d%3d#activityfeeds------activityfeeds is my div – nazar tvm Apr 22 '15 at 05:55
-