MVC :: Display User-specific Information In My Master Page
Sep 4, 2010
I have a need to display user-specific information in my master page. As a result, I have set up all of my controllers to be inherited from a "master" controller. This has worked well for other aspects of the master page, such as displaying random quotes. However, while using this technique to incorporate the user-specific information, I ran into a problem where, when I check the Request.IsAuthenticated value, the Request object is null.
Here is my "master" controller:
Curiously - at least to me - is that the Request object becomes populated by the time program flow hits the Home Controller:
I have a online game (written in ASP) which i have finally decided to convert to ASP.NET. However i cannot seem to link the login ID's of users to their specific details in the database. I.E when Joe Bloggs logs in, he will be shown the team information for just his club, not every club. in ASP I use code similar to this below
im not convinced that is the right syntax to be using, but when i execute the code in Query Builder it is showing me the correct data (that i expect to see). So im wondering if there is something else im missing? Is there something extra that i need to be adding in Web.Config file or elsewhere?
I have a master page with a partial view. I want the partial view to display only when viewing a specific page/action. Is there any conditional I can wrap around the partial view that checks for the page/action I'm viewing?
Normally I dont have the login link in the master page. But I have the labels to display the user information on top of master page once logged in and have the sign in option in content page which contains that master page. After sign in , i want to display the user information on the top of the master page without redirecting user to the same page? How can we do this?
how can I retrieve information when the user clicked on a specific link without opening a new web page? The information is stored in the database which is through web service. For example, when the user click on a specific link, e.g the date 28 February 2010, the datagrid will display the information on 28 February 2010.
I'm making a small portal in ASP.net (with C#.net4) where users can login and add, edit their personal information (PI). But I don't get how to load information (stored in a SQL server DB) in the page when a specific user is logged in.
For example: If Sam is logged in, he can view his PI. When Vicky is logged in, she can view her PI.
I have the membership provider and the create user with tow steps, one of the steps contains a custom registration form, for each created user data will be in the database, and there is an account page shows the data that the new created user did insert during the registration process on the custom registration page,
the problem, when the user is created and logged into his account page, this account page shows only the information for the first created user, not the info on the logged in user , but the logged in user data still saved in database and not showing on his account page?
I'm building my application (MVC 2) based on the prototype supplied by the designer (HTML)
I started out with using Master pages, and about to use Nested Master Pages as well My <body> tag should have a page specific id, to let the css do it's job (I'm not supposed to change the markup or css..that way I can just swap out new css, should the designer want to "update")
The <body> tag sits in my header..... problem.
I can set some ViewData variable in the controller, and pop that in the id attribute for the body tag, but it does not feel right.
I am currently useing forms authenticantion with users set up with the Membership API and I have there other information like first name and work phone number stored useing the Profiles API. I want to create a company directory useing a grid view to display every user and there profile information. I can use Membership.GetAllUsers() or ProfileManager.GetAllProfiles() but it does not list any of the custom profile information like name and phone. What is the best way to get a grid view to show all the user information?
whats the exact use of static variables in overall programming in .net and for asp.net...
Recently i went for the interview where interviewer asked me 2 question which i was not sure for the same..