Thanks for the quick reply, Janaka.
I looked over the the <link> tag a dozen times, both in the IDE and in the
rendered source code...but you're right!
It seems that using the vanity URL on the root directory is what threw me.
Because the URL was redirected to a subdirectory, the <link> tag no longer
applied. All I did to fix this was add an extra <link> tag in the
UserPage.aspx HTML source code that omitted the "../", directing the <link>
to the subdirectory instead of up one level
In other words, I changed my links from this:
<LINK href="../scripts/Styles.css" type="text/css" rel="stylesheet ">
<LINK href="../scripts/Menus.css" type="text/css" rel="stylesheet ">
to this:
<LINK href="../scripts/Styles.css" type="text/css" rel="stylesheet ">
<LINK href="../scripts/Menus.css" type="text/css" rel="stylesheet ">
<LINK href="scripts/Styles.css" type="text/css" rel="stylesheet ">
<LINK href="scripts/Menus.css" type="text/css" rel="stylesheet ">
A word of caution to anyone else trying this, *everything* is thrown off if
you redirect the context to a different subdirectory, including all your
links, image src, etc. It's much easier (and *much* less messy) to just
have the destination page in the same directory as your vanity URL.
Thanks again,
Eric
"Janaka" <ja****@magical ia.com> wrote in message
news:uA******** ******@TK2MSFTN GP12.phx.gbl...
Eric
I'm guessing that your css is not being referenced because the page cannot
find the relative path to the stylesheet.
Try making your stylesheet reference absolute such as <link
href="/styles.css" type="text/css" rel="stylesheet ">
Janaka
"Eric Lemmon" <er************ *@hotmail.com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. . Greetings,
I wrote code to handle vanity URLs, so--for example--the URL
http://localhost/myApp/bsmith.aspx is internally translated to
http://localhost/myApp/Support/UserP...px?user=bsmith.
The problem is that whenever I access the vanity URL,
http://localhost/myApp/bsmith.aspx, the page shows without any CSS
styles...quite ugly. However, when I get to the page directly using its
actual address,
http://localhost/myApp/Support/UserP...px?user=bsmith, it displays fine.
Does anyone know what I'm doing wrong? (The Global.asax.vb code is
below)
Thank you!
Eric
'\\\
' NOTE: This code assumes "Imports System.IO"
Sub Application_Beg inRequest(ByVal sender As Object, _
ByVal e As EventArgs)
' Fires at the beginning of each request
Dim strPageOwner As String
Dim strCurrentPath As String
Dim strCustomPath As String
strCurrentPath = Request.Path.To Lower
With strCurrentPath
' Make sure the request is for the vanity URL, where it is
an ' aspx page in the root directory, and it is not
Default.aspx.
If .IndexOf("defau lt.aspx") = -1 AndAlso _
.IndexOf("/products/") = -1 AndAlso _
.IndexOf("/secure/") = -1 AndAlso _
.IndexOf("/support/") = -1 AndAlso _
.IndexOf("/about/") = -1 Then
strCustomPath = String.Format( _
"/myApp/Support/UserPage.aspx?u ser={0}", _
Path.GetFileNam eWithoutExtensi on(Request.Path ))
Context.Rewrite Path(strCustomP ath)
End If
End With
End Sub
'///