Last post Jun 17, 2019 04:47 PM by srbhrthr
May 30, 2019 04:08 PM|mrzoz|LINK
when should I use
file name directly
May 30, 2019 09:12 PM|KathyW|LINK
You use ~/folder name in a context that is processed on the server by asp.net, such as in asp.net controls. It references the application root as ~ and describes the path from that root.
You use '../folder name in the context of standard HTML, not server controls, where this example constructs a URL that is up one from the current folder, then down to the named folder, In standard HTML you can also use "/folder" where "/" means the root
of the site, which is generally also the root of the application.
May 31, 2019 01:50 AM|Wei Zhang|LINK
According to your description, you could see the details as below:
1 '..' means one path level up (so if you're on /somefolder/index.aspx and you reference ../style.css then the latter would have to be in the parent folder of someFolder)
2 '~/' means the root path of the current project is only valid on the server side.
3 if you directly use file ,it means the current file in the same folder.
Jun 17, 2019 04:47 PM|srbhrthr|LINK
../folder name is used to access or go to the file or folder of the previous directory,
It can be used as ../../folder name to go two levels up. This is used while using relative paths.
You can refer this for more information on Path Reference: https://www.javatpoint.com/html-file-path
~/folder name is used to resolve to the correct location, regardless of which folder it is called from.
<asp:Image ID="image1" runat="server" ImageUrl="~/images/img.jpg"/>
on a page the framework will substitute the correct path to "images/img.jpg" where the folder "images" is present from the root.