Https and images and js files

A

ABCL

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 using https://...and on login 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
 
B

BusEdge

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://...andon login 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
 
A

ABCL

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
 
B

BusEdge

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- Hide quoted text -

- Show quoted text -

Are you using Windows Authentication? If so, then you need to check
file/folder permissions on those folders like where the images are.
You need to make sure that the user who authenticates has access to
read those files.

-Brandon
==================
http://www.busedge.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top