I have an application in ASP.Net MVC, after the user logs in I need to show their name at the top of the page, regardless of what page it is.
This application is an administrative where the name of the company will be at the top, I saw some solutions to my problem but I can not decide which would be better, because I have little knowledge.
Build a base controller by searching the name of the company and returning it to a viewbag .
Now I have a question about viewbag , if I use the first option and create a controller that returns to that viewbag use them on pages? In case I need only use in [discriminação]
, right? Could someone give me an example?
I have little idea about this part which is hindering my learning, I would like a slightly more didactic answer about the operation of even viewbag , I found other answers on this subject but I could not understand them completely.