Click here to Skip to main content
15,891,033 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionCustomer Hacking System Time Pin
Klockness18-Dec-12 4:33
Klockness18-Dec-12 4:33 
AnswerRe: Customer Hacking System Time Pin
Richard MacCutchan18-Dec-12 6:46
mveRichard MacCutchan18-Dec-12 6:46 
GeneralRe: Customer Hacking System Time Pin
Klockness18-Dec-12 10:25
Klockness18-Dec-12 10:25 
AnswerRe: Customer Hacking System Time Pin
Richard Deeming18-Dec-12 7:32
mveRichard Deeming18-Dec-12 7:32 
GeneralRe: Customer Hacking System Time Pin
Klockness18-Dec-12 10:26
Klockness18-Dec-12 10:26 
QuestionCan only book for yourself and not other users? Pin
xnaLearner17-Dec-12 1:26
xnaLearner17-Dec-12 1:26 
AnswerRe: Can only book for yourself and not other users? Pin
Richard MacCutchan17-Dec-12 3:27
mveRichard MacCutchan17-Dec-12 3:27 
Questionusing [Authorize] mvc3 Pin
xnaLearner17-Dec-12 1:02
xnaLearner17-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

HTML
<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
C#
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
professionalEddy Vluggen17-Dec-12 1:08 
AnswerRe: using [Authorize] mvc3 Pin
xnaLearner17-Dec-12 1:25
xnaLearner17-Dec-12 1:25 
QuestionAdding a flash webcam photo capture Pin
lhsunshine16-Dec-12 19:33
lhsunshine16-Dec-12 19:33 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 0:42
professionalEddy Vluggen17-Dec-12 0:42 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 1:55
lhsunshine17-Dec-12 1:55 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 2:01
professionalEddy Vluggen17-Dec-12 2:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 2:07
lhsunshine17-Dec-12 2:07 
QuestionRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 2:09
professionalEddy Vluggen17-Dec-12 2:09 
AnswerRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 13:49
lhsunshine17-Dec-12 13:49 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 2:01
professionalEddy Vluggen18-Dec-12 2:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 18:03
lhsunshine18-Dec-12 18:03 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 19:18
lhsunshine18-Dec-12 19:18 
GeneralRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 20:40
professionalEddy Vluggen18-Dec-12 20:40 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine19-Dec-12 2:28
lhsunshine19-Dec-12 2:28 
QuestionMessage Removed Pin
16-Dec-12 7:11
watercoldworld16-Dec-12 7:11 
QuestionSplitting a url Pin
El Dev14-Dec-12 22:02
El Dev14-Dec-12 22:02 
Questionpulling across value from list to display in view Pin
xnaLearner14-Dec-12 5:58
xnaLearner14-Dec-12 5:58 

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

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