Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > ASP.NET 4.5 General Discussion
ASP.NET 4.5 General Discussion For ASP.NET 4.5 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4.5 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 11th, 2015, 04:59 AM
Registered User
Join Date: Jun 2014
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Changing Menu Control Orientation on the Fly

I'm trying to make my website more responsive, but I can't figure out how (if it's possible) to make my nav menu change orientation if the browser window size crosses a threshold. i.e. If the window width was 600px and the user changed the window width to 1000px, then I would want the menu orientation to change from horizontal to vertical when the 900px mark has been crossed.

I've been looking for a while, but I haven't found a viable solution. It looks like there was some experimentation with it in ASP.Net 2.0, but i'm skeptical to try it because it is severly outdated and probably won't work.

I know I can do something where I have in my CodeBehind for my MasterPage to look at the theme and, depending on the theme, change the menu orientation what I want for that theme. The problem with that solution is that it's entirely on the server side and it wouldn't make the layout responsive.
Old February 11th, 2015, 06:48 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

I would look into Bootstrap. It's a great framework for responsive sites. A menu that adapts is pretty simple to implement. Here's an example: http://getbootstrap.com/examples/navbar/

The ASP.NET Menu doesn't work well with Bootstrap, but it should be fairly easy to replace it with static HTML or something like a Repeater control top output clean HTML.


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Screen Orientation Epicurus BOOK: Beginning iPhone SDK Programming with Objective-C 2 March 30th, 2011 09:45 PM
Crystal Report Changing Orientation garrysmith68 Beginning VB 6 0 June 6th, 2006 06:42 AM
parsing a changing text file on the fly Kannkor VB How-To 0 November 14th, 2005 01:47 AM
Changing Table structure on the fly Tallon Wolle Pro VB 6 1 January 21st, 2004 10:36 AM
Changing Menu made with VB 4 Menu Editor Zooker VB How-To 1 July 26th, 2003 11:44 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.