This in itself causes problems, but can be handled. You'd think IIS would
be able to handle it though. If you look at the site links above and hover
over the tabs on the page you will see this difference in URL generation
using the Request.ApplicationPath. It is the EXACT same code deployed to
both a virtual directory and the root. One works, one does not.
This is the code:
*Extra spaces have been added to prevent HTML rendering in this message*
< a href='< %= Application("AppPath") % >/DesktopDefault.aspx?tabindex< %#
Container.ItemIndex % >=&tabid=< %# Ctype(Container.DataItem,
TabStripDetails).TabId% >' class="OtherTabs">< %# Ctype(Container.DataItem,
TabStripDetails).TabName % ></a>
I realize the ~ only works with the new ASP.NET controls and will not work
in this case.
Any input would be greatly appreciated.
Thanks,
Brock
That said, I cant see exactly what your problem is. You seem to need
something a little more flexible, like the root & the application path
together. You might find the URL object more flexible for your needs.
Try using the Request.URL object, its very flexible in breaking down the
actual request location. Try this:
Request.Url.GetLeftPart(UriPartial.Authority)
--
Regards
John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional Windows Forms
ISBN: 1861005547
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------
"Brock" <br...@vrsdata.com> wrote in message
news:uGlhOvTyBHA.2324@tkmsftngp02...
Thanks for the reply,
Brock
"John Timney (Microsoft MVP)" <xyzti...@btinternet.com> wrote in message
news:ePhuJzUyBHA.2856@tkmsftngp05...
The problem is this. When deployed to a virtual directory, I need the
root/virtual dir. When deployed to the root, I need just the root. That is
where the tilde and the ApplicationPath are having problems. Neither one of
them works in BOTH scenarios.
Brock
"John Timney (Microsoft MVP)" <xyzti...@btinternet.com> wrote in message
news:ePhuJzUyBHA.2856@tkmsftngp05...
' Build the Application Path
If Application("AppPath") = Nothing Then
Dim sAbsUri As String = Request.Url.AbsoluteUri
Dim sRawUrl As String = Request.RawUrl
If Request.ApplicationPath = "/" Then
Application("AppPath") = Left(sAbsUri, Len(sAbsUri) - Len(sRawUrl))
Else
Application("AppPath") = Left(sAbsUri, Len(sAbsUri) - Len(sRawUrl)) &
Request.ApplicationPath
End If
End If
Then just replace all the script calls for <%= Request.ApplicationPath%>
with <%= Application("AppPath")%>
If you have any other suggextions, let me know.
Brock
"Brock" <br...@vrsdata.com> wrote in message
news:uGlhOvTyBHA.2324@tkmsftngp02...