Click here to Skip to main content
       

.NET Framework

 
QuestionCustomer Hacking System Time PinmemberKlockness18-Dec-12 5:33 
AnswerRe: Customer Hacking System Time PinmvpRichard MacCutchan18-Dec-12 7:46 
GeneralRe: Customer Hacking System Time PinmemberKlockness18-Dec-12 11:25 
AnswerRe: Customer Hacking System Time PinmemberRichard Deeming18-Dec-12 8:32 
GeneralRe: Customer Hacking System Time PinmemberKlockness18-Dec-12 11:26 
QuestionCan only book for yourself and not other users? PinmemberxnaLearner17-Dec-12 2:26 
AnswerRe: Can only book for yourself and not other users? PinmvpRichard MacCutchan17-Dec-12 4:27 
Questionusing [Authorize] mvc3 PinmemberxnaLearner17-Dec-12 2: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 PinmemberEddy Vluggen17-Dec-12 2:08 
AnswerRe: using [Authorize] mvc3 PinmemberxnaLearner17-Dec-12 2:25 
QuestionAdding a flash webcam photo capture Pinmemberlhsunshine16-Dec-12 20:33 
AnswerRe: Adding a flash webcam photo capture PinmemberEddy Vluggen17-Dec-12 1:42 
GeneralRe: Adding a flash webcam photo capture Pinmemberlhsunshine17-Dec-12 2:55 
AnswerRe: Adding a flash webcam photo capture PinmemberEddy Vluggen17-Dec-12 3:01 
GeneralRe: Adding a flash webcam photo capture Pinmemberlhsunshine17-Dec-12 3:07 
QuestionRe: Adding a flash webcam photo capture PinmemberEddy Vluggen17-Dec-12 3:09 
AnswerRe: Adding a flash webcam photo capture Pinmemberlhsunshine17-Dec-12 14:49 
AnswerRe: Adding a flash webcam photo capture PinmemberEddy Vluggen18-Dec-12 3:01 
GeneralRe: Adding a flash webcam photo capture Pinmemberlhsunshine18-Dec-12 19:03 
GeneralRe: Adding a flash webcam photo capture Pinmemberlhsunshine18-Dec-12 20:18 
GeneralRe: Adding a flash webcam photo capture PinmemberEddy Vluggen18-Dec-12 21:40 
GeneralRe: Adding a flash webcam photo capture Pinmemberlhsunshine19-Dec-12 3:28 
QuestionSplitting a url PinmemberEl daniel14-Dec-12 23:02 
Questionpulling across value from list to display in view PinmemberxnaLearner14-Dec-12 6:58 
AnswerRe: pulling across value from list to display in view PinmemberxnaLearner14-Dec-12 7: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.141220.1 | Last Updated 18 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid