Welcome Guest Search | Active Topics | Sign In | Register

Menu: HTTPS flag? Options
Afflicted
Posted: Saturday, December 29, 2007 2:01:57 PM
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.
eo_support
Posted: Saturday, December 29, 2007 2:09:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
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
Afflicted
Posted: Saturday, December 29, 2007 2:13:41 PM
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.
eo_support
Posted: Saturday, December 29, 2007 2:47:21 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
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

Afflicted
Posted: Sunday, December 30, 2007 9:35:23 AM
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.aspx

Second, 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.
eo_support
Posted: Sunday, December 30, 2007 9:41:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Awesome! thanks for sharing!
Afflicted
Posted: Sunday, December 30, 2007 9:44:17 AM
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 :)


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.