.aspx path references

I can’t believe it took me this long to figure this out.

But anyway if you want to get a reference to the root of your server in .Net you need to use

“~\”

For example:

Dim header As HeaderControl =
 CType
(LoadControl(“~\controls\Header.ascx”), HeaderControl)

Anyway hopefully this helps someone out who is wondering about relative paths when coding in .Net

-Josh

Posted: August 4th, 2005
Categories: Technical
Tags:
Comments: No Comments.