Simple path question
-
I noticed that several places you can use "~" to start a path for the application root. This does not seem to work for CSS files or for JavaScript files. Is there an inline way to ensure that the path in the browser starts at the root? It seems that there has to be a way for the ~ to be converted to a server name at least on the server then appended to the front of the relative path in the browser. Thanks,
Leo T. Smith Program/Analyst Supervisor
-
I noticed that several places you can use "~" to start a path for the application root. This does not seem to work for CSS files or for JavaScript files. Is there an inline way to ensure that the path in the browser starts at the root? It seems that there has to be a way for the ~ to be converted to a server name at least on the server then appended to the front of the relative path in the browser. Thanks,
Leo T. Smith Program/Analyst Supervisor
You can use the
Page.ResolveUrl
method or thePage.ResolveClientUrl
method to turn a path containing ~ into a path usable in the browser. This of course doesn't work for CSS files or Javascript files, as there is no server code in them.Despite everything, the person most likely to be fooling you next is yourself.