Re: Https and images and js files

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

.



Relevant Pages

  • Re: Https and images and js files
    ... css and .js files on the login page. ... You should use relative paths to your included js/css/image ... That is why once user will authenticate the ... images are displaying, but w/o autheticate it is not displaying- Hide quoted text - ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Login control and restricted member pages
    ... As you said the login dialog prompts each time the page loading a image, ... protected folder. ... When a page display some images file, ... NTFS permission limitation. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Login control and restricted member pages
    ... As you said the login dialog prompts each time the page loading a image, ... protected folder. ... When a page display some images file, ... the root members folder isn't. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How do I retrieve images dynamically based on the login username?
    ... FayeC wrote: ... users are provided with username and password by the admin). ... The users are supposed to login to a specific page where they can see 4 images. ...
    (comp.lang.php)
  • Re: how to create a gallery without using the EXIF function?
    ... >will have the same username as the user's login. ... >After login the user is taken to a page that will contain the 4 images ... >in the folder arranged in a table or div. ...
    (comp.lang.php)