Click here to Skip to main content
11,500,623 members (76,999 online)

.NET Framework

 
QuestionCustomer Hacking System Time Pin
Klockness18-Dec-12 4:33
memberKlockness18-Dec-12 4:33 
AnswerRe: Customer Hacking System Time Pin
Richard MacCutchan18-Dec-12 6:46
mvpRichard MacCutchan18-Dec-12 6:46 
GeneralRe: Customer Hacking System Time Pin
Klockness18-Dec-12 10:25
memberKlockness18-Dec-12 10:25 
AnswerRe: Customer Hacking System Time Pin
Richard Deeming18-Dec-12 7:32
memberRichard Deeming18-Dec-12 7:32 
GeneralRe: Customer Hacking System Time Pin
Klockness18-Dec-12 10:26
memberKlockness18-Dec-12 10:26 
QuestionCan only book for yourself and not other users? Pin
xnaLearner17-Dec-12 1:26
memberxnaLearner17-Dec-12 1:26 
AnswerRe: Can only book for yourself and not other users? Pin
Richard MacCutchan17-Dec-12 3:27
mvpRichard MacCutchan17-Dec-12 3:27 
Questionusing [Authorize] mvc3 Pin
xnaLearner17-Dec-12 1:02
memberxnaLearner17-Dec-12 1:02 
So at the top of my controllers i've added in [Authorize], So far so good only logged in users can access these pages (Person and Holiday)

However the tabs in the homeController which navigate the users to these pages are still displayed...coming from the layout.cs

      <li>@Html.ActionLink("Home", "Index", "Home")</li>
            <li>@Html.ActionLink("About", "About", "Home")</li>
            <li>@Html.ActionLink("Person", "Index", "Person")</li>
            <li>@Html.ActionLink("Holidays", "Index", "Holidays")</li>
How can I only get these tabs to display if a user is logged in.

I have tried the approach of adding in a bool in the AccountController.cs
else
                    {
                        loggedIn = true;
                        return RedirectToAction("Index", "Home");
                    }
                }
                else
                {
                    loggedIn = false;
                    ModelState.AddModelError("", "The user name or password provided is incorrect.");
                }
but then how do I access this from the layout.cs?

Is this the correct approach. Please advise. thanks
QuestionRe: using [Authorize] mvc3 Pin
Eddy Vluggen17-Dec-12 1:08
memberEddy Vluggen17-Dec-12 1:08 
AnswerRe: using [Authorize] mvc3 Pin
xnaLearner17-Dec-12 1:25
memberxnaLearner17-Dec-12 1:25 
QuestionAdding a flash webcam photo capture Pin
lhsunshine16-Dec-12 19:33
memberlhsunshine16-Dec-12 19:33 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 0:42
memberEddy Vluggen17-Dec-12 0:42 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 1:55
memberlhsunshine17-Dec-12 1:55 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 2:01
memberEddy Vluggen17-Dec-12 2:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 2:07
memberlhsunshine17-Dec-12 2:07 
QuestionRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 2:09
memberEddy Vluggen17-Dec-12 2:09 
AnswerRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 13:49
memberlhsunshine17-Dec-12 13:49 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 2:01
memberEddy Vluggen18-Dec-12 2:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 18:03
memberlhsunshine18-Dec-12 18:03 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 19:18
memberlhsunshine18-Dec-12 19:18 
GeneralRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 20:40
memberEddy Vluggen18-Dec-12 20:40 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine19-Dec-12 2:28
memberlhsunshine19-Dec-12 2:28 
QuestionSplitting a url Pin
El daniel14-Dec-12 22:02
memberEl daniel14-Dec-12 22:02 
Questionpulling across value from list to display in view Pin
xnaLearner14-Dec-12 5:58
memberxnaLearner14-Dec-12 5:58 
AnswerRe: pulling across value from list to display in view Pin
xnaLearner14-Dec-12 6:49
memberxnaLearner14-Dec-12 6:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 1 Jun 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid