|
Rank: Advanced Member Groups: Member
Joined: 9/13/2007 Posts: 51
|
Hello,
Is there any way to flag a menu items navigateUrl to use the HTTPS protocol?
I have built a custom expression builder that will take a relative path (i.e. "~/Secure/MyPage.aspx) and translate this to "https://www.clearchoicehp.com/Secure/MyPage.aspx, however I cannot figure out how to make a menu item use the https protocol.
Can someone point me in the right direction?
Thanks!
Matt L.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
There is nothing special you need to do. As long as the page that contains the menu is https, a relative path will be automatically https. If the page that contains the menu is not https and you want the target page to be https, you would need to use the full path.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 9/13/2007 Posts: 51
|
Doh,
The page that contains the menu is not https, and I was hoping to use a relative link because my site will go through a path to production, namely first my local server, then a testing server, then a staging server, then the production server.
My menu has hundreds of items and they are databased, so I will have to manually modify the full path on each of the different servers for testing. I was hoping to be able to get around this by using relative pathing, and then setting some type of flag that will mark the navigateUrl as https.
So there is no way to do this correct?
Thanks!
Matt L.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You could use our client side JavaScript interface to do that, that way you will be basically doing the navigation all by yourself, our menu only provides you the UI elements.
The way our menu handles relative link is exactly the same as a relative link in a normal HTML page. If you have an HTML page and you put in a relative link there, the target link will have the same HTTPS/HTTP attributes as the original page. So there is nothing out of norm there.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 9/13/2007 Posts: 51
|
In case anyone else out there is wondering how to do this, here is how I accomplished it: First I created a class that will create the https link based on this web site: http://www.leastprivilege.com/PartiallySSLSecuredWebAppsWithASPNET.aspxSecond, I stored my navigateUrl for the menu items as "HttpsUrl:~/<path here>" (for instance: HttpsUrl:~/Secure/MySecurePage.aspx) Last, I handled the OnItemDataBound event of the menu and checked for "HttpsUrl:" in the NavigateUrl string. If it was found, I used this code to create the SSL link: DataRow row = (DataRow)e.MenuItem.DataItem; if (row["MenuItemNavigateURL"].ToString().Contains("HttpsUrl:")) { e.MenuItem.NavigateUrl = SslTools.GetAbsoluteUrl(row["MenuItemNavigateURL"].ToString().Replace("HttpsUrl:", ""), ProtocolOptions.Https); } Hope this helps someone else too :) Matt L.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Awesome! thanks for sharing!
|
|
Rank: Advanced Member Groups: Member
Joined: 9/13/2007 Posts: 51
|
No problem at all!
By the way, the EO Menu rocks! It has been so easy to use and code against. Great job :)
|
|