views:

24

answers:

3

I have upload control on my asp.net page. I upload pictures in folder cars and they show in windows explorer when I open that folder (cars), but in Visual Sudio they act like they not include in project ( that is the reason why they don't show on image control which point to some of them. What did I make wrong ?

+1  A: 

Uploading the images in the web application will never make any changes to your project. You will have to add them manually if you'll need them there. But generally these are pictures added by your user so the would just be in the file system - not really part of the solution, are they?

steinar
My folder where I store them is under solution in my project.
Damir
Yes, but you'll have to add them specifically to the project itself. It's not enough that they're in a folder in the path of your project.
steinar
One more question, pls. I have one page where I upload that pictures under location =Request.PhysicalApplicationPath + "\\images\\car\\" + photo_one= and store path to database, on another page I read from database and need to put inside Image tag, but that doesn't work. It works for pictures I addes manualy. What to do ?
Damir
A: 

You have to click the refresh button at the top of the solution explorer in Visual Studio for it to show changes to the files.

jarrett
I done that couple times but it doesn't help.
Damir
A: 

You have to click Refresh button. Also ensure that "Show all files" icon is selected. And finally, you will have to right click on the files and select Include in Project. That way it would become part of your project.

If I may ask, what exactly are you trying to achieve in your application? The reason I ask is, if there is an upload happening in your application, you shouldn't need to include the files in your project to refer to it from code.

Rahul Soni