p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 3.5 Basics (http://p2p.wrox.com/forumdisplay.php?f=351)
-   -   Using File structure in ASP.NET (http://p2p.wrox.com/showthread.php?t=72894)

Spider February 23rd, 2009 03:06 PM

Using File structure in ASP.NET
 
I have an application which is beginning to take shape. I have an Admin folder, which can only be accessed when the user is logged in.

I have the main page built on a master page and as such there are some links that won't work when I am inside the folder structure; ie when I try to navigate to 'Home' from within the /Admin/Asmin.aspx page it cannot find it. I assume this is something to do with absolute links.

Is there some way to direct every link via the home page? Because I think if this was the case, all the links could be found once a user has passed the particular login criteria.

I have got a site map working, and I know that the breadcrumb feature works from wherever the user is.

Lee Dumond February 23rd, 2009 04:16 PM

Make sure you use the tilde (~) character which automatically resolves server control URLs.

<asp:HyperLink ID="lnkHome" runat="server" NavigateUrl="~/Home.aspx" />

Spider February 23rd, 2009 05:30 PM

Lee
Thanks a lot! - that was an easy one to fix, I was coming at it from old school html:
<ahref="Default.aspx">Default.aspx</a></p> - no surprise it wouldn't work!


All times are GMT -4. The time now is 07:38 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.