473,842 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Https and images and js files

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

Mar 2 '07 #1
3 2304
On Mar 2, 8:03 am, "ABCL" <ohm...@hotmail .comwrote:
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.co m/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.ServerV ariables["HTTPS"] == "on" ?
"https://" : "http://";

Then in your aspx page, you would have <img src="<%=sHttps
%>www.somedomai n.com/images/image.gif">

HTH,
Brandon
=============== ===
http://www.busedge.com

Mar 2 '07 #2
On Mar 2, 10:21 am, "BusEdge" <spil...@gmail. comwrote:
On Mar 2, 8:03 am, "ABCL" <ohm...@hotmail .comwrote:
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.co m/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.ServerV ariables["HTTPS"] == "on" ?
"https://" : "http://";

Then in your aspx page, you would have <img src="<%=sHttps
%>www.somedomai n.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

Mar 2 '07 #3
On Mar 2, 1:15 pm, "ABCL" <ohm...@hotmail .comwrote:
On Mar 2, 10:21 am, "BusEdge" <spil...@gmail. comwrote:


On Mar 2, 8:03 am, "ABCL" <ohm...@hotmail .comwrote:
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://...andonloginpa ge 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.co m/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.ServerV ariables["HTTPS"] == "on" ?
"https://" : "http://";
Then in your aspx page, you would have <img src="<%=sHttps
%>www.somedomai n.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

Mar 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5197
by: Gary Feldman | last post by:
I think I've found a deficiency in the design of urllib related to https. In order to complete an https connection, it appears that URLOpener and hence FancyURLOpener require the key and cert files. Or at least, it's not clear from the description of socket.ssl what it does if they're omitted. However, urlopen has no way to specify such things. Nor should it - for typical uses, a person simply trying to retrieve data from an ssl site...
6
17178
by: Todd Peterson | last post by:
I'm encountering some wierd behavior with a <link> tag over an HTTPS connection, vs. an HTTP connection... In an ASP/HTML page on my website, I've add a <link rel="shortcut icon"...> in order to allow the users to add a shortcut (with icon) on their desktop, as well as seeing the icon in the URL. Our development server allows both HTTP and HTTPS connections, but the icon only appears to be available when requesting the page via HTTP???...
2
2324
by: Gill Bates | last post by:
I'm trying to login to a banking site (https://www.providentconnection.com) using vb.net. I've tried many variations of WebClient and HttpWebRequest; none of which I've got to work. My latest version is: Dim myWebClient As New WebClient Dim nvc As New NameValueCollection nvc.Add("Login", username) nvc.Add("Password", password)
14
2523
by: Peter Chant | last post by:
I'm currently authenticating a site I have built using basic http authentication built into apache. This has zero overhead on php which is a bonus but it seems to not quite work how I'd like. Are the username and password in the login box that comes up encrypted? When I login https://mysite.local:portnum I get the login dialog. As I am using a self signed certificate I see the dialog stating warning me about it first before the login...
7
2608
by: Ryan Taylor | last post by:
Hi. I have some code that dynamically generates a PDF and spits this content directly to the web browser. I use HTMLDoc to create the Pdf's from html. So the user can click on a button "Print PDF" and the current page magically becomes a PDF file. This worked great until we moved the site to https. Now, when the button is clicked, I get a warning that This page contains both secure and nonsecure items. Do you want to display the...
2
1041
by: abcd | last post by:
I am using https protocol and some of my pages are using relatie paths to our images folder and gif files... when the page is rendered the images are not rendered.....is there anything wrong with https and relative urls....I am using Windows 2003...or may be permission issue somewhere...
0
1322
by: zxcv | last post by:
I have inherited an app that is using java to generate images that it loads into a PDF via external-graphic in XSL-FO. The problem I have is that my architecture environment is going to require in a few months that all calls made from my app be done via HTTPS. Currently the app makes these image source calls via HTTP. However, it seems to me that FOP is incapable of issuing these HTTPS requests. The code never gets called, while as a...
2
2605
by: Nader Shahin | last post by:
I tried to develop an application to download a file from an Https server. My application was able to download a file from a regural Http server. I used a WebProxy and i passed the NetworkCredential, but also it didn't work like:- Dim myProxy As New WebProxy("https://TheServername.com/", 443) Also I used that way to create a class to accept all kinds of certifications, and also it didn't work.
2
4133
by: bizt | last post by:
Hi, I have a page that makes many XmlHttpRequest requests from a single page. This works fine but I need some requests to be made over a secure connection. To my understanding, when setting the location of the path to the file to fetch during the XmlHttpRequest request it has to the be the path relative to the web page such as /secret.php and NOT a full URL such as https://www.example.com/secret.php .. is this about the general idea??...
0
9872
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9715
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10314
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5696
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4499
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4089
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.