I have a web app that runs fine in Visual web developer. But when I publish it to IIS, a link as follows: href="/Default.aspx" doesn’t work. The page’s address is now: http://localhost/ MyApp.net/Default.aspx .
So I tried adding a tilde: href="~/Default.aspx" but the browser is looking for: http://localhost/ MyApp.net/~/Default.aspx .
This is important because I would actually like to publish to a folder instead of wwwroot, but would not like to hardcode the path.
You need to include runat=”server” to have it resolved from the root.