Wrox Programmer Forums
|
ASP.NET 4.5 General Discussion For ASP.NET 4.5 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4.5 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2014, 12:38 PM
Registered User
Points: 22, Level: 1
Points: 22, Level: 1 Points: 22, Level: 1 Points: 22, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2014
Posts: 5
Thanks: 4
Thanked 1 Time in 1 Post
Unhappy Displaying Images in List View

Please help me how to display images in List view with SqlDatasource as you have explained with EntityDataSource in chapter 14 , Page 515 try it out, i am having trouble using the file upload control , how can i use the file upload control ? .

Last edited by dipjyoty; October 26th, 2014 at 11:42 PM..
 
Old October 27th, 2014, 02:15 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you show your working code and a more detailed description of the issues you're running into? The FileUpload should behave the same, no matter the data control you're using.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
dipjyoty (October 28th, 2014)
 
Old October 28th, 2014, 01:39 PM
Registered User
Points: 22, Level: 1
Points: 22, Level: 1 Points: 22, Level: 1 Points: 22, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2014
Posts: 5
Thanks: 4
Thanked 1 Time in 1 Post
Lightbulb

Code:
FileUpload FileUpload1 =
(FileUpload)ListView1.InsertItem.FindControl(“FileUpload1”);
string virtualFolder = “~/GigPics/”;
string physicalFolder = Server.MapPath(virtualFolder);
string fileName = Guid.NewGuid().ToString();
string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
FileUpload1.SaveAs(System.IO.Path.Combine(physicalFolder, fileName + extension));
myPicture.ImageUrl = virtualFolder + fileName + extension;
what should i do with this
Code:
myPicture.ImageUrl = virtualFolder + fileName + extension;
while using a sqldatasource ?
 
Old November 3rd, 2014, 03:38 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can store the value in e.Values["ImageUrl"] or e.NewValues["ImageUrl"] depending on which event you're handling.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
dipjyoty (November 6th, 2014)





Similar Threads
Thread Thread Starter Forum Replies Last Post
displaying images chandan121 JSP Basics 0 May 1st, 2008 09:59 PM
Help Grid View Drop Down List, view all jskinner123 ASP.NET 2.0 Basics 0 November 25th, 2007 06:25 PM
Displaying images...... kethireddy435 ASP.NET 2.0 Professional 0 September 16th, 2007 09:25 PM
populate details view or list view non empty rows iinfoque ASP.NET 2.0 Basics 0 March 11th, 2007 06:11 AM
Images not displaying Penn_Clark Dreamweaver (all versions) 3 February 21st, 2006 12:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.