Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting the proper URL in user control
Message
 
 
To
22/08/2008 14:21:34
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01341120
Message ID:
01341199
Views:
10
>>>>>. I thought I needed to find a way to reference from the web root, but not sure how. The directory I am in seems to be always appended first before what is placed here.
>>>>
>>>>That's what the / prefix does - it starts the URL path from the root of the website. So a link that points to /MembersOnly/MemberPortal.aspx should work from anyplace in the site. Are you sure that's exactly how the links are rendering on each page? And, for example "MemberPortal.aspx" actually exists in a subfolder named "MembersOnly" (and not in the root)?
>>>
>>>I had changed them all to this:
>>>
>>><ul class="menutextindent">
>>>    <li><a href="/MembersOnly/MemberHome.aspx">Members Home</a></li>
>>>    <li><a href="/MembersOnly/MemberPortal.aspx">Member Portal</a></li>
>>>    <li><a href="/MembersOnly/MeetingPortal/OnlineMeeting.aspx">Online Meeting</a></li>
>>>    <li><a href="/MembersOnly/Documents.aspx">Documents</a></li>
>>>    <li><a href="/MembersOnly/Maintenance/CommonGrounds.aspx">Common Grounds</a></li>
>>>    <li><a href="/MembersOnly/PostData.aspx">Post Data</a></li>
>>>    <li><a href="/MembersOnly/MemberForum.aspx">Member Forum</a></li>
>>></ul>
>>>
>>>
>>>Odly when I place my mouse over the link it shows correctly in the bottom such as
>>>http://localhost:3275/MembersOnly/MemberPortal.aspx
>>>but when I click on it I get an Error 404 - Not found message.
>>>Tim
>>
>>If you put this link in your address bar, does the page display?
>
>Ok, I just ran the web app, logged in, and was at the MemberHome page. I changed the url from:
>http://localhost:3275/POAAEWeb/MembersOnly/MemberHome.aspx
>to this manually - It works when I type it in manually.
>http://localhost:3275/POAAEWeb/MembersOnly/MemberPortal.aspx
>
>Equivalent to this if it was published to the host:
>http://www.aeroestates.org/MembersOnly/MemberPortal.aspx

In your links this portion POAAEWeb is missing, thus you're getting an error. I suggest to use Request.ApplicationPath to set your paths correctly. But you would need to set them in code.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform