J
John Kotuby
Hi all..
In a VS2005 ASP.NET 2.0 website application I am using a regular HTML anchor
(actually a number of them) in a page that produces Excel output because a
server control is really not needed here. I am using a relative path in the
anchor such as:
<a href= "/Common/ListView.aspx"
My understanding is that I cannot use the syntax:
<a href="~/Common/ListView.aspx"
....if I am not declaring a Server control. Maybe I am wrong there... but
anyway...
I want to create in Global.asax a session variable - UrlRoot - that I can
reference anywhere in the application that holds the virtual root whether
the app is running on my dev machine, a local testing server, or the remote
production server like so ...
<a href= UrlRoot & "/Common/ListView.aspx"
I have tried:
Session.Add("URL_Root", "http://" & Request.Url.Host)
Session.Add("URL_Root", "http://" &
HttpContext.Current.Request.ApplicationPath)
Session.Add("URL_Root", VirtualPathUtility.ToAppRelative("/"))
No matter what method I use or where I run the app the link dynamically
created in the Excel file seems to be returning:
http://localhost/Common/ListView.aspx
rather than
http://www.prodserv.com/Common/ListView.aspx
Can anyone lend assistance? I need the URL_Root to return the root domain of
what the User would type into the browser to get to the correct page.
Thanks...
In a VS2005 ASP.NET 2.0 website application I am using a regular HTML anchor
(actually a number of them) in a page that produces Excel output because a
server control is really not needed here. I am using a relative path in the
anchor such as:
<a href= "/Common/ListView.aspx"
My understanding is that I cannot use the syntax:
<a href="~/Common/ListView.aspx"
....if I am not declaring a Server control. Maybe I am wrong there... but
anyway...
I want to create in Global.asax a session variable - UrlRoot - that I can
reference anywhere in the application that holds the virtual root whether
the app is running on my dev machine, a local testing server, or the remote
production server like so ...
<a href= UrlRoot & "/Common/ListView.aspx"
I have tried:
Session.Add("URL_Root", "http://" & Request.Url.Host)
Session.Add("URL_Root", "http://" &
HttpContext.Current.Request.ApplicationPath)
Session.Add("URL_Root", VirtualPathUtility.ToAppRelative("/"))
No matter what method I use or where I run the app the link dynamically
created in the Excel file seems to be returning:
http://localhost/Common/ListView.aspx
rather than
http://www.prodserv.com/Common/ListView.aspx
Can anyone lend assistance? I need the URL_Root to return the root domain of
what the User would type into the browser to get to the correct page.
Thanks...