Maybe I wasn't clear, but I need a lot more information that this. This should be real easy to fix, but somehow you can't seem to provide me with the information I need to fix your problem.
My apologise for the confusion.When I referred to the Internet Explorer I meant windows explorer.I checked in the windows and it gave me the very same error message.I see C:\Site\Pics in the dialog box(shown on page 463,in the "browse" text box).
How can that be? How can Windows Explorer give you th exaxct same error message as a run-time Exception in ASP.NET? I find that hard to believe. If you're trying to look up the actual image, it makes sense it isn't there as the image isn't saved. So, open a Windows Explorer, click your C drive. Do you see a Site folder? Double click to open it. What do you see? web.config, ManagePhotoAlbum.aspx and so on? And do you see a Pics folder? If so, double-click it. Does it contain any files?
1.My website is mainly structured according to how the book is detailed.The web config is located at the end of my site before the site map(it's not in any folder).
But in which physical folder? How are these files stored on your hard drive? In which folder? And when you choose File | Open Web Site in VWm, which folder do you choose?
2.By setting the needed changes to the site as the book said.What I see in the browers address bar after I run it:http:// local:53122/ManagePhotoAlbuma.aspx.
That's good. It means you're using a root-based site which makes things easier.
3.FileUpload1.SaveAs(System.IO.Path.Combine(physic alFolder,filename + extension));
Right. But this is really not enough. What does physicalFolder and filename contain? Where do they get a value? What happens when you look at the variables while debugging? I assume you're using MapPath somewhere but which folder do you pass to it?
4.There are no security settings reason being all I did was just rename the folder to "Pics" that's why it appears like that.
How do you know there are no security settings? Can you be explicit about what you did? How did you check the security settings and what did you see exactly? Did you follow the instructions in the book?
I am asking a lot of questions, but that's because you're not really providing the information I need. I can't see what you're doing, don't have access to your hard drive and don't know how you set things up. All I know is what you tell me, and things like "There are no security settings" and "the web config is located at the end of my site before the site map" are certainly not explicit enough to help you out.
To summarize how things *should* be (adapted for your situation):
1. You have a folder called C:\Site
2. This folder contains a subfolder called Pics. E.g. C:\Site\Pics
3. The account used by the web server (you, or an IIS account) is able to write to C:\Site\Pics
4. Your site in VWD is setup to look in C:\Site. E.g. you see the webconfig, managephotoalbums etc directly in the root of the site in the Solution Explorer. You also see the Pics folder in VWD
5. You set up the Virtual Path to / This means when you run the site you get something like http://localhost:12345/ManagePhotoAlbum.aspx
6. The code that saves the file to disk uses something like this:
string virtualFolder = "~/Pics/";
string physicalFolder = Server.MapPath(virtualFolder);
Dim virtualFolder As String = "~/Pics/"
Dim physicalFolder As String = Server.MapPath(virtualFolder)
Where, ~/Pics is made physical by MapPath. It should return C:\Site\Pics, or one of the earlier requirements in this list are not met.
Now, if you keep having troubles with this, try to describe the past 6 points the way they are set up on your system, and please, please, be explicit and crystal clear.