C# - MVC Can Create Dynamic Navigation Sub-menu On The Master Page?
May 16, 2010
I'm trying to create an ASP.NET MVC master page so the site navigation on it will look like this:
Main Menu:Home | About | News
Sub Menu: Home_Page1 | Home_Page2
The Sub Menu section should always show sub-menu for the currently selected Main Menu page (on the example above 'Home' page is selected) unless a user hovers the mouse on another Main Menu item (then it shows that item's sub-menu instead).
I want to have a side navigation menu (Vertical Orrientation) for a master page. Now the problem is, when I created a web form and include my created masterpage, the objects inside the content placeholder of a webform appears in the bottom of the side navigation menu. I want to make the objects appear at the right side of my navigation menu. How can this be done??
I'm starting with ASP.NET MVC (1.0). I have a problem to resolve. I have developed a web applicaton (an application of articles like e-commerce) with a head (logo and menu). I have defined the head (logo and menu) in the Master page (site.master). Now, I must display the number of articles in the head in a field (like the number of articles in the virtual basket in the e-commerce). I can read the number of articles in the data base (in the controller), but i can't integrate it in the master page.
So i want to create a simple menu but i'm just getting started so here is my thoughts.
2)Sitemap ok for menus and roles?
3)I'm testing a menu control with a SiteMapDataSource. Ok i have much problems but the no1 problem is that i want the tabs to go horizontal in the page and not vertical.
I thought i could change the sitemap but it only allows on sitemapnode. Here is a sitemap i have done long time ago and i used it. I don't know why i have set p.e. ?cat=usr, probably wrong?I don't get anything from a querystring.Ajnyway i thought i'll leave it so you may comment.
I am having a problem with my menu. My navigation menu gets created with data from different tables in a database. When the page loads after a few minutes the navigation menu disappears from page. Does anyone have had this problem or knows how to fix it?
I've been tasked with managing the re-write of a very large enterprise application's UI. The existing UI was built upon an infrastructure which leverages the EntLib 3's PageFlow application block and the Web Client Software Factory. It performs horribly - part of the reason we need this upgrade so badly.
The problem is that these pageflows are very complex, using extensive conditional page transitions. When editing a data form, selection of a single value can determine not only what page you will reach when you click "Next", but whether a sub-pageflow is entered upon navigation instead, or a new pageflow is opened in parallel, etc. We deploy our UI in such a way where we control our API, but we allow certain licenses to purchase our UI code and extend/modify it as they deem fit. One of our selling points is that we allow the customer to "configure" or redefine pageflows using the VS designer.
In transitioning to MVC2 (or 3), we'd like to continue to offer configurable, conditional navigation throughout our various data entry page sequences. However, although I have developed the beginnings of our app in MVC2, I'm not sure the best way of implementing this data-entry pageflow "conversion". Sure, I've had my resources produce some solid designs - but all of them seem to require implementation of a complex controllerfactory. But one of the main attractions of MVC2 for me was its lightweight codebase and resultant performance gains - and I'm afraid that bypassing portions of MVC2 functionality by writing custom factories and the like will drastically reduce the performance of the app, making our UI refresh virtually worthless.
My initial thought was to write a custom filter that would implement the OnActionExecuted method. Every controller's primary POST methods would be marked with this attribute. Upon execution it would evaluate what view the user was on and look up the navigation event for that view in configuration. This config would have a default "next page"/"previous page" mapping, and can also allow for defining a type which would use conditional logic to determine the next page based on the posted model data. The actionfilter would use this type to find what route to navigate to next. I'd like to pick you experts' brains on this - does this seem like a solid design? Is it using best practices? And will it indeed perform better than a controller factory, or am I completely off-base here?
I am developing an medical Application. This application has 3 Types of users. In this application I have to use a single master for displaying menus and i have to change the menus based on the user. Since i have to use ul, li tags to create menus. How can i set the Text for this li tags in server side.
I have an asp:Menu control on a master page that is reading its menu items from a web.sitemap file via a SiteMapDataSource.When I click on a menu, the new page loads which uses the same master page, but the ASP:Menu vanishes. I have put some plain text next to the menu for testing, this appears on the new page but the menu does not.Does anyone know how to get the asp:Menu to remain visible on the page?
Im building a navigation and want to display the current page (Default.aspx, OtherPage.aspx) the user is on with a class.Right now I just have a bunch of links as <a> tags.Here is a my menu:
As you can see the Default.aspx has the class active, but that is just something I put in.How do I do this dynamically?I know I can use Path.GetFileName(Request.FilePath) to get what page the user is on.
I have a drop down list embedded in a menu panel in my master page. This ddl fetches it's list items from my SQL Server. They are:
1. Select a type --appended during page load
2. Green type -- fetched from SQL server via a datasource
3. Red type -- fetched from SQL server via a datasource
4. User Manual -- appended during page load
For the sake of simplicity my website has 4 pages. When the 'Select a type' list item is selected - the user should be taken to a general 'Introduction' page. When the 'Green type' - the user should be taken to a 'Green' page - and etc.
I'm using asp.net and css to style a master page with navigation at the top. I was hoping to add the login status control in as a menu item but it is not allowed. Can someone point me in the right direction? When I post my code on this forum do I have to include tags?
I need to create 2 level deep menu. The first level is static and horizontal. And i need the second dynamic level to be horizontal. Is there any oprion for dynamic menu item or it can be done by css somehow?
I've buit a menu functionallity in my MVC app where you can add/remove and modify navigation items:
this is what it looks like in the database (the key thing to notice here is URL field where i'm storing all Area/Controller/Action/Param values.
Now, on the front end I would like to built <UL><LI> menu from the db.
How would I know what page I'm on so that I can add class "current" to <li>. If for example I'm in "http://localhost/Admin/Admins/Dashboard" how would i know it applies to /Admin/Dashboard AND /Admin/Dashboard/Index?
-another thing. how would i handle params. For example when I'm on page /Admins/ContactUs/Edit/32 - how would i match this to /Admin/ContactUs/Edit/ ?