views:

22

answers:

1

Hello,

i'm creating an Asp.Net application and i need to load an UserControl via https. So, in my page i'm loading it with the following code:

...
<%@ Register src="../../pages/controls/bar.ascx" tagname="bar" tagprefix="uc1" %>
<html>
<body>
...
<uc1:bar ID="bar1" runat="server" />
...
</body>
</html>

Here the UserControl is correctyle loaded via http. So what should i do to load it from the same position but via the https protocol (the certificate is already configured)?

Thanks

A: 

If your main site is HTTP and you are wanting to load a HTTPS control, you will need to enter a absolute URL and not a relative URL in your src line.

<%@ Register src="https://mysite.com/pages/controls/bar.ascx" tagname="bar" tagprefix="uc1" %>

However, I would like to point out that mixing HTTPS and HTTP content is generally frowned upon (think of the popups your browser gives you when images/js/css is served up on an HTTP connection for a HTTPS site.).

Why not make this page or any page using this control SSL only? You could even group all of these pages into one sub directory and make that SSL only.

Tommy