I'm building an eCommerce site using DNN vertion 5. The site requires SSL certificate on some pages, special to the products registration page.
The site url is a normal url, something like http://www.myecommerce.com. When user has navigated to the site which the url, and then go to the product registration page, the site will redirect "http://www.myecommerce.com/productregistration.aspx" to https://www.myeommcerce.com/productregistration.aspx". To do that, i have inserted below code in the skin file:
<script runat="server">
Protected Sub btnReservation_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If Not (Me.Request.IsSecureConnection) Then
Dim serverName As String = HttpUtility.UrlEncode(Request.ServerVariables("SERVER_NAME"))
Dim filePath As String = "/Reservations.aspx"
Response.Redirect("https://" + ServerName + filePath)
End If
End Sub
</script>
As you see, the page has a link which is a server LinkButton like "<asp:LinkButton runat="server" ID="btnReservation" Text="RESERVATIONS"
CssClass="main_menu" onclick="btnReservation_Click"></asp:LinkButton>"
When user click on RESERVATIONS link, the page will redirect from http to https to be over SSL.
But when user click the link button, a exception has occured, something like "Exception has been thrown by the target of an invocation"
I have traced the exception, and see that the exception has occured at the first line in the method OnInit in the file admin/Skins/Nav.ascx.vb
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
InitializeNavControl(Me, "SolpartMenuNavigationProvider")
AddHandler Control.NodeClick, AddressOf Control_NodeClick
AddHandler Control.PopulateOnDemand, AddressOf Control_PopulateOnDemand
MyBase.OnInit(e)
End Sub
I have tried a lot but i haven't found a solution for the problem.
Please help me, thank you very much !