Re: Https and images and js files
- From: "ABCL" <ohmp05@xxxxxxxxxxx>
- Date: 2 Mar 2007 10:15:41 -0800
On Mar 2, 10:21 am, "BusEdge" <spil...@xxxxxxxxx> wrote:
On Mar 2, 8:03 am, "ABCL" <ohm...@xxxxxxxxxxx> wrote:
Hi
I have asp.net web site that is working well on my m/c if I access
using http://
But I depyoed on production,It requiers to use https:// , If i browse
tha page usinghttps://...andonlogin page it doesn't link images,
css and .js files on the login page. Once the user login successfully
and try to browse login page agian, The images and .js files are
working fine
what can be problem? how to solve it?
Thanks in ADvance
It sounds like you might be using full URL paths to your images and js
files. If you have an https:// page and in your html code you have
<img src="http://www.mydomain.com/images/image.gif" then you will have
problems. You should use relative paths to your included js/css/image
files, i.e. <img src="/images/image.gif"> and you shouldn't have any
problems.
The alternative is to create a variable in your code behind, something
like this:
string sHttps = Request.ServerVariables["HTTPS"] == "on" ?
"https://" : "http://";
Then in your aspx page, you would have <img src="<%=sHttps
%>www.somedomain.com/images/image.gif">
HTH,
Brandon
==================http://www.busedge.com
I am using relative path, That is why once user will authenticate the
images are displaying, but w/o autheticate it is not displaying
.
- Follow-Ups:
- Re: Https and images and js files
- From: BusEdge
- Re: Https and images and js files
- References:
- Https and images and js files
- From: ABCL
- Re: Https and images and js files
- From: BusEdge
- Https and images and js files
- Prev by Date: Adding items on an aspx page doesn't cause them to be created in the code behind.
- Next by Date: RE: Creating a list of checkboxes dynamically
- Previous by thread: Re: Https and images and js files
- Next by thread: Re: Https and images and js files
- Index(es):
Relevant Pages
|