TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mark Tabor
587
2k
460.7k
How to pass multiple models to _Layout.cshtml
Sep 8 2016 11:55 PM
I am a newbie MVC developer , I made a simple website in which i have _Layout.cshtml in the layout i have different partial views like for header , for footer they are static and my work goes well, now the situation arises where i have a Menu link Like services and these services are coming from database so i made a simple database table I am new to mvc i do not know how to get data from database into the partial view ,
secondly i did the above task via internet help but now when i am calling this partial view then it is already having one model referenced so i cannot reference another model like @model Myapplication.Models.Service
How i can render a partial view in _layout.cshtml without giving the model reference in the _layout.cshtml or how to give multiple models in _layout.cshtml.
Thanks for reply
Reply
Answers (
1
)
Website vs Webapplication vs webforms vs mvc
how to clear session in mvc4 when i click on add button?