views:

486

answers:

4

I have a modal that I implemented using the jQuery Colorbox and the modal works great for everything. However I have to have the functionality of an 'Update Your Picture' Member picture area and I wanted to acheive this through AJAX. Apparently this is possible but not really through AJAX. I have tried to implement the AJAX Upload function using this guy's method

AJAX Upload

but am not being sucessful, I am starting to think that it is because I load the functionality into the DOM later on (because of the modal). Does anyone have any method and examples for doing a photo upload done with javascript(jQuery preferably) and ASP.Net (C#). It would be greatly appreciated.

Thanks

A: 

I always use iframes to do any types of upload...you can show/hide your iframe with javascript and the c# page in the iframe can handle any type of database updating you need...let me know if you want an example...

chad
you should avoid iframes as much as possible. Instead use updatepanel (part of ajaxcontroltoolkit).
waqasahmed
why should you avoid iframes?
seanlinmt
@waqasahmed An updatepanel is not going to do an ajax file upload. Only an iframe will. An iframe is a perfectly fine solution in this case.
Jace Rhea
A: 

If you think that your problem is because you "load the functionality into the DOM later on" you should try to use the jQuery live event (new in 1.3) or the LiveQuery plugin

Eduardo Molteni
+2  A: 

Similar question and a solution :

http://stackoverflow.com/questions/3803502/image-upload-preview-in-update-panel/

Direct link to sample application here

Zuuum