Saturday, March 24, 2012

Upload image in Tab container

Hi,

I have a tab container which has 3 tabs Picture, profile and Description......

On clicking Picture tab i need to upload an image and display.....

But i am not able to do so......

pls help me....

Hi,

Thank you for your post!

Here is a good article aboutuploading-files-without-a-full-postback:http://msmvps.com/blogs/luisabreu/archive/2006/12/14/uploading-files-without-a-full-postback.aspx

Our good old friend the IFrame used to be the preferred option for asynchronous http communications. Because an iframe is in essence it's own browser window, it can be used to fire off asynchronous requests (both POST and GET). However, even more important is an IFrame's ability to be a 'target' of a form POST. By adding an IFrame to the page and setting it as the target of the form post, you can in essence create an asynchronous file transfer.

When you upload your image to the server,display it like this:

<asp:Image ID="Image2" runat="server" Visible="False" />
Image2.ImageUrl = "the path you saved the image to";

Image2.Visible = true;


For more infoemation, see:

AJAX, file downloads, and IFRAMEs

http://blogs.infragistics.com/blogs/tony_lombardo/archive/2007/04/09/file-uploads-where-s-the-ajax.aspx

If you have further questions,let me know.

Best Regards,

No comments:

Post a Comment