0
I have an application in ASP.Net MVC, after the user login need to show his name at the top of the page always, regardless of which page he is.
This application is an administrative where will be the name of the company at the top, I saw some solutions to my problem but I can not decide which would be better, for having little knowledge.
Build a base controller by searching for the company name and returning it to a viewbag.
I don’t remember well because I didn’t find the question again, but it was to use the pattern
[discriminação]
us controllers (if someone can explain to me how it is done).
Now a question I have about viewbag, if I use the first option and create a controller who returns to this viewbag, how will I use them on the pages? In case I just need to use on Shared\_Layout
, right ? Someone could give me an example?
I have little notion about this part which is hindering my learning, I would like a somewhat more didactic answer about the functioning of even the viewbag, I found other answers on this subject but could not fully understand them.
You are using what for authentication, Identity?
– Randrade
I didn’t do the login part, but I just asked a question about login and what I saw is not Identity, because it uses a redirect file called 'Starup.Auth.Cs' and doesn’t have this file in the project, i redirected it on web.config using the '<Authentication mode="Forms">' I don’t know if it helps .
– William Cézar
You will use this value for some operation or just to show on screen?
– Randrade
Just show her on the screen
– William Cézar