string path = context.Server.MapPath("~/Temp");
or
string path = context.Server.MapPath("/Temp");
are same ?
I know that ‘~’ represents root but want to know diff bw ~/folder and /folder
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See http://msdn.microsoft.com/en-us/library/ms178116(v=vs.100).aspx
~/resolves to the application root./resolves to the site root.When a server resource (like a control or view) is rendered,
~/paths are resolved to site root paths based on the structure and context of the application (since~/is meaningless to a web browser).To simplify, application root (
~/) is almost always the correct choice in ASP.Net applications (both web forms and MVC).