Avatar of elmbrook
elmbrook
 asked on

How do I display information gathered from database in _layout templace? MVC4

Hi

I would like to pull some information out of the database depending on some information I store to a session.

Using asp we do that in the load event of a page and then assign the result to a asp label.

I am able to do it in the views but I am not sure how to do it in a template.

Any help is always appreciated.
C#

Avatar of undefined
Last Comment
elmbrook

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Craig Wagner

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
elmbrook

ASKER
Thanks Craig.

This is my first MVC project and you are right about stopping thinking in terms of webforms.
However, I needed to explain how I wanted it to work .

In the end I went with solution 2 which was easy to implement.

Thanks.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23