Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the proper URL in user control
Message
De
22/08/2008 14:31:20
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01341120
Message ID:
01341202
Vues:
12
>>>>>>. 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.

I caught that as you did also. I wonder if this would be a non issue if I just published the changes. The problem is with the host there is no POAAEWeb involved. I would think the "/" would just resolve to the root, where running local it is resolving to the root of the virtual web server. I am going to try to publish it as is and see if it works in the hosted enviornment.
I will let you both know.
Thank You
Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform