views:

220

answers:

1

Hi, I am working on eCommerce app Using Asp.net 3.5 MVC. On my Cart View I have checkout button that redirect to Checkout action on the same controller:

<%= Html.ActionLink("CheckOut", "CheckOut") %>

My controller looks like this:

    [RequireSsl(Redirect=true)]
    public ActionResult CheckOut()
    {
        return View();
    }

But when I click on checkout the URL seems to be correct: (see update) https://localhost/Cart/CheckOut but I get following error:

Data Transfer Interrupted

The connection to localhost was interrupted while the page was loading.
The browser connected successfully, but the connection was interrupted while transferring information.  Please try again.

Any idea what I am doing wrong?

UPD: Actually after redirection the port number is gone. (I am using ASP.Net development server). But even typing in address box correct url produce the same error

+1  A: 

Is the site setup in IIS? If not, that could be the issue. I do not believe the Visual Studio Debugger supports SSL.

xeb
You are correct. ASP.NET Development Server is not set up to handle SSL. You are much better off using IIS in Vista or Windows 7.
Dan Atkinson
Thanks, I am trying to run this in ASP.NET Development Server. I am not ready to deploy it yet to IIS7 but hope that it will work...Is there any way to configure ASP.NET Development Server to ignore SSL requests?
Michael D.
I don't know of a way to have the ASP.NET Development Server ignore SSL requests. What I usually do is make a custom SSL redirect (often in a Base Controller) that I can control with a Web.config setting like "EnableSSL" -- then when you are deploying to production or a test server, just turn EnableSSL on -- if you are developing locally, leave EnableSSL off. Hope that helps!
xeb