Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 02, 2012 07:49 AM by Song-Tian - MSFT
Member
67 Points
321 Posts
Jun 29, 2012 10:15 AM|LINK
in my create user profile using file upload option upload image file and show that image in image control using ajax without refreshing the page... and then resize that image before going to show because my image control size is 400x400... how to do this???please tel friends
All-Star
86555 Points
9624 Posts
Moderator
MVP
Jun 29, 2012 10:23 AM|LINK
It uses jQuery instead of ASP.NET AJAX, but here is a solution to your question:
Ajax image upload and viewing: http://www.magic-dev.com/ajax-image-upload.htm
Jun 29, 2012 10:45 AM|LINK
is there possible do this in asp:fileupload option friend????
116 Points
38 Posts
Jun 29, 2012 11:08 AM|LINK
Use This Link in that same thread is discussed...
http://stackoverflow.com/questions/4721114/asyncfileupload-show-image-after-upload-without-refreshing-the-page
Jun 29, 2012 11:34 AM|LINK
cannot access AsyncFileUpload protected void AsyncFileUpload1_UploadedComplete1(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { User objUser = new User(); string filename = System.IO.Path.GetFileName(AsyncFileUpload1.FileName); HttpPostedFile pf = AsyncFileUpload1.PostedFile; System.Drawing.Image img2 = System.Drawing.Image.FromStream(pf.InputStream); System.Drawing.Image bmp2 = img2.GetThumbnailImage(200, 200, null, IntPtr.Zero); // Imagename = objUser.UserID + filename; Imagename = filename; Imagepath = "D:\\ShopMonkey_WebApp_29062012\\ShopMonkey_WebApp\\ShopMonkey\\Images\\" + Imagename; bmp2.Save(Path.Combine(@"D:\ShopMonkey_WebApp_29062012\ShopMonkey_WebApp\ShopMonkey\Images\", Imagename)); objUser.UploadImagePath = Imagepath; objUser.UploadImagename = Imagename; System.Drawing.Image img1 = System.Drawing.Image.FromFile(Imagepath); System.Drawing.Image bmp1 = img1.GetThumbnailImage(50, 50, null, IntPtr.Zero); ThumbNailPath = "D:\\ShopMonkey_WebApp_29062012\\ShopMonkey_WebApp\\ShopMonkey\\ThumbNails\\" + Imagename; bmp1.Save(Path.Combine(@"D:\ShopMonkey_WebApp_29062012\ShopMonkey_WebApp\ShopMonkey\ThumbNails\", Imagename)); objUser.UploadThumbnailPath = ThumbNailPath; //Check_Pin(objUser); Img_Show.ImageUrl = objUser.UploadImagePath; } it wont show image...i cannot access able AsyncFileUpload1_UploadedComplete1..it checks the loop and out from that loop.. i already add reference ajax dll in my project..another that have to add any dll??? can u please anyone tel solution for this friend????
65619 Points
11118 Posts
Jul 02, 2012 03:33 AM|LINK
REfer this following thread
http://forums.asp.net/t/1320559.aspx
http://forums.asp.net/t/962719.aspx
http://forums.asp.net/t/1793075.aspx/1
43699 Points
4304 Posts
Microsoft
Jul 02, 2012 07:49 AM|LINK
Hi,
And you also using a asp.net image control. And then set the imageurl with webservcie or page method.
For webservcie, please refer to: http://msdn.microsoft.com/en-us/library/bb398995(v=VS.90).aspx.
And pagemethod, please refer to: http://blogs.microsoft.co.il/blogs/gilf/archive/2008/10/04/asp-net-ajax-pagemethods.aspx.
girikas
Member
67 Points
321 Posts
how to show image in asp.net image control using ajax without refresh
Jun 29, 2012 10:15 AM|LINK
in my create user profile using file upload option upload image file and show that image in image control using ajax without refreshing the page...
and then resize that image before going to show because my image control size is 400x400...
how to do this???please tel friends
DarrellNorto...
All-Star
86555 Points
9624 Posts
Moderator
MVP
Re: how to show image in asp.net image control using ajax without refresh
Jun 29, 2012 10:23 AM|LINK
It uses jQuery instead of ASP.NET AJAX, but here is a solution to your question:
Ajax image upload and viewing: http://www.magic-dev.com/ajax-image-upload.htm
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
girikas
Member
67 Points
321 Posts
Re: how to show image in asp.net image control using ajax without refresh
Jun 29, 2012 10:45 AM|LINK
is there possible do this in asp:fileupload option friend????
nizam.mcts
Member
116 Points
38 Posts
Re: how to show image in asp.net image control using ajax without refresh
Jun 29, 2012 11:08 AM|LINK
Use This Link in that same thread is discussed...
http://stackoverflow.com/questions/4721114/asyncfileupload-show-image-after-upload-without-refreshing-the-page
girikas
Member
67 Points
321 Posts
Re: how to show image in asp.net image control using ajax without refresh
Jun 29, 2012 11:34 AM|LINK
cannot access AsyncFileUpload
protected void AsyncFileUpload1_UploadedComplete1(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
User objUser = new User();
string filename = System.IO.Path.GetFileName(AsyncFileUpload1.FileName);
HttpPostedFile pf = AsyncFileUpload1.PostedFile;
System.Drawing.Image img2 = System.Drawing.Image.FromStream(pf.InputStream);
System.Drawing.Image bmp2 = img2.GetThumbnailImage(200, 200, null, IntPtr.Zero);
// Imagename = objUser.UserID + filename;
Imagename = filename;
Imagepath = "D:\\ShopMonkey_WebApp_29062012\\ShopMonkey_WebApp\\ShopMonkey\\Images\\" + Imagename;
bmp2.Save(Path.Combine(@"D:\ShopMonkey_WebApp_29062012\ShopMonkey_WebApp\ShopMonkey\Images\", Imagename));
objUser.UploadImagePath = Imagepath;
objUser.UploadImagename = Imagename;
System.Drawing.Image img1 = System.Drawing.Image.FromFile(Imagepath);
System.Drawing.Image bmp1 = img1.GetThumbnailImage(50, 50, null, IntPtr.Zero);
ThumbNailPath = "D:\\ShopMonkey_WebApp_29062012\\ShopMonkey_WebApp\\ShopMonkey\\ThumbNails\\" + Imagename;
bmp1.Save(Path.Combine(@"D:\ShopMonkey_WebApp_29062012\ShopMonkey_WebApp\ShopMonkey\ThumbNails\", Imagename));
objUser.UploadThumbnailPath = ThumbNailPath;
//Check_Pin(objUser);
Img_Show.ImageUrl = objUser.UploadImagePath;
}
it wont show image...i cannot access able AsyncFileUpload1_UploadedComplete1..it checks the loop and out from that loop..
i already add reference ajax dll in my project..another that have to add any dll???
can u please anyone tel solution for this friend????
chetan.sarod...
All-Star
65619 Points
11118 Posts
Re: how to show image in asp.net image control using ajax without refresh
Jul 02, 2012 03:33 AM|LINK
REfer this following thread
http://forums.asp.net/t/1320559.aspx
http://forums.asp.net/t/962719.aspx
http://forums.asp.net/t/1793075.aspx/1
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
Song-Tian - ...
All-Star
43699 Points
4304 Posts
Microsoft
Re: how to show image in asp.net image control using ajax without refresh
Jul 02, 2012 07:49 AM|LINK
Hi,
And you also using a asp.net image control. And then set the imageurl with webservcie or page method.
For webservcie, please refer to: http://msdn.microsoft.com/en-us/library/bb398995(v=VS.90).aspx.
And pagemethod, please refer to: http://blogs.microsoft.co.il/blogs/gilf/archive/2008/10/04/asp-net-ajax-pagemethods.aspx.
Feedback to us
Develop and promote your apps in Windows Store