Relatively new to VC 2019 and working on an ASP.NET MVC tutorial. After the implementation of the View, Model, and Controller classes, when I run the service, my upper menu is gone :/
I am not sure if this is a coding or library error is. I also am not sure how to debug this.
Please advice,
AUU
Menu is gone
Please check that "navbar" class exists in div tag of _Layout page is deleted or changed to display:none. The attached image shows that the Navbar for menu buttons comes from this master page named _Layout.cshtml
The navbar that looks:
Nav bar from _Layout.cshtml page:
Related
I have a umbraco solution, which has a below piece of code in my view,
var home = Model.AncestorOrSelf(1);
var primaryNav = home.GetPropertyValue<IEnumerable<IPublishedContent>>("primaryNav").Where(n => n.GetPropertyValue<bool>("hideFromNavigation") == false);
From my Umbraco back office, can someone please tell me how can i find the nodes which satisfy the above piece of code.
I'm trying to a new node to the existing navigation bar, but it is not coming up. What could i be missing here?
Please let me know, i'm new to umbraco.
My Umbraco version is 7.2.1
Also, what could be the meaning of "primaryNav", here home.GetPropertyValue<IEnumerable<IPublishedContent>>("primaryNav")
Go to the root page of the website in the back office content tree. On that page there should be a content picker called something like "Primary Nav".
That should show up all of the selected items that should appear. It's also checking for a hide from navigation property, which you'd have to check individually on each of the selected nodes.
How are you trying to add the node to the menu? If it's via the picker, then it SHOULD work, unless the page has the hide from navigation checkbox checked. Also make sure you publish the root page once you've added the page to the picker rather than just saving.
The only other thing that might be causing it to not show up would be if the Partial that renders the navigation is being cached. Look in the view and see if it's using CachedPartial, and if so, that may be your culprit.
I'm using ASP.NET MVC with Razor C# and I have implemented a main menu appearing on every page through _Layout.cshtml.
One of the pages linked to this menu opens a page that includes a secondary menu.
This page with the secondary menu links to several different pages which are navigated via the same secondary menu.
I've used Partial views to hold each secondary menu page, and I'm wondering what is the easiest/preferred way to output these partial pages via the page with the secondary menu? (Or perhaps I shouldn't even be using Partial views to save having to add the secondary menu to each page).
Thanks.
Ok, A friend, who is also working on the same problem, just showed me this: https://www.youtube.com/watch?v=SrlU8sr5Tqc
So the answer seems to be Nested Layouts.
I'm developing a ASP.NET MVC5 razor project and I have a cshtml divided into two parts, left part has a div with a treeview with options like a menu and the right part is a div that I would like to load cshtml that correspond to the option selected in treeview, ¿how can I do to achieve this?
Thanks
I am making the assumption that this is a simple navigation that is consistent amongst all pages, for which you can put the common navigation in the _Layout.cshtml. This file contains all the common , , tags used for each page. If you put your navigation in here then it will also be displayed on each page.
The navigation options can then link to your normal actions which display the corresponding views within the layout page.
In this tutorial the author discusses adding a simple navigation (in the section "Using a Layout for common site elements") in the _Layout with the difference that the navigation is at the top and not at the side. You can use css to style the page differently.
I am using Umbraco 6 for MVC. My problem arises in my Navigation. It works as expected except on mobile devices. The navigation is modeled after the one seen here: http://htmlstream.com/unify/
On Mobile Devices, the dropdown sub nav links don't navigate to any other pages. When you expand a nav element with subpages and touch a sub nav link, it simply closes the dropdown.
I generate the navigation using a Razor partial view for each of the pages. It will start at the root and loop through creating a link for each visible node one level under the root. Upon reaching a node that has child nodes, the razor script will create sub nav items before moving along. This leaves me with a nice collapsible dropdown navigation that translates well to mobile devices.
The Urls for each of the nodes whether it is a main nav element or a sub nav element, are created in the foreach loop using #var.NiceUrl()
Perhaps this causes a problem but I can't figure out why all of the other links, whether on the main navigation or as buttons throughout the page, would work fine despite being created with the same .NiceUrl() method.
Anyone have any insight?
Please try to add the following code, in your style sheet:
.dropdown-backdrop
{
position: static;
}
i am using partial view for my project but my problem is that my links are on right side of masterpage and when i clicked on particular link the view should displayed on left side on contentplace holder of master page. but right now its showing exactly below so my whole disgne is distrubed.
how to position partial view in asp.net mvc through java script?
so please if anyone know the solution tell me.
thanks
Do you basically mean your HTML is not set to allow the Content on the left, and the Menu on the right?
Maybe you would benefit from a CSS Layout Template? Put the Content placeholder in large column, and the menu PartialView in the side bar.
It might be a problem with your page CSS. Look at your styles for "Float" 's. If you want your content to be to the left of your page, surround your contentPlaceHolder with a div tag and add a "float:left" style to it.
If that doesn't work it might be your view is wider than your master page design is set up for. So it will pop below every other page element to fit on your page!
This is not realy asp.net mvc specific but html. You will have a better chance to solve your problem if you tag your question as html and css.
You can just save the source (I mean the rendered source from within the browser) of the page that doesnt display properly with the extension html in the root of your web. Then start playing with the html.
Request the page by calling http://yourserver/yourpagetodebug.html.