1

I have an ASP.NET registration form which I want the user to upload their photo in it. I need to show the image immediately after the user selected it without page postback.

I assume I have to use Asynchronous File Upload, right? But is there a way to show the image without actually saving it on server? Because I need to check if all entered data by user is valid and then allow the program to upload user's photo to server.

Thanx in advance.

Payam Sh
  • 581
  • 4
  • 9
  • 21

1 Answers1

1

How to upload an image with jQuery client side and add it to a div? you would have to do a Client side load of the image first... and use ajax to validate the user information. If the first ajax call is validated then you make yet another ajax call from your javascript including the image.

Community
  • 1
  • 1
Softwarehuset
  • 815
  • 4
  • 10
  • That's ok, thanx. But now another question! How can I retain the image after postback? One approach is saving its value to a hidden field and read it after postback but we can't save the value of input type=file into hidden field! Would you help me? :) – Payam Sh Dec 07 '14 at 20:55