Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

https and http issues ...

Posted on 2006-04-06
1
Medium Priority
?
158 Views
Last Modified: 2012-08-13
an ssl certifiacte was installed and I would like to add a fucntionalit which will detect whether or not person is coming from HTTP or HTTPS and if a person is accessing a login URL by typing in HTTP it should redirect him to HTTPS version. Please take a look at the below code. It seems that this code executes all the time and it doesn't get to other parts of the code. I added Response.Write at the bottom for testing purposes and I never get to that line, code redirects to https and a loging functionality is ignored.


if(Page.IsPostBack)
{
                        if (Page.Request.Url.Scheme.ToLower() != "https")
                              Response.Redirect("https://" + Page.Request.Url.AbsoluteUri.Substring(Page.Request.Url.AbsoluteUri.IndexOf(Page.Request.Url.Host)));

//login functionality starts here
Response.Write("Login Functionality");
}
0
Comment
Question by:TransBind
1 Comment
 
LVL 12

Accepted Solution

by:
bsdotnet earned 2000 total points
ID: 16397532
think you should remove if(Page.IsPostBack)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question