Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET MVC4
this is my application s menu..
I want that before authentication the first tabs be clear and after that I want that the other tabs will be clear and the first tabs disapear!!!!!!
 

Posted 3-Jan-13 0:54am
loylmed374
Comments
joshrduncan2012 at 3-Jan-13 15:15pm
   
What is the problem exactly?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You're not using Razor, in MVC4 ? Why not ?
 
You need to do the check if the user is authenticated and then do an 'else' to render the other stuff only when they are not.
  Permalink  
Comments
loylmed at 7-Jan-13 8:20am
   
can u give me an example plz?
Christian Graus at 7-Jan-13 14:24pm
   
<% if (Request.IsAuthenticated)
{ %>
<%: Html.ActionLink("test", "test", "Home")%>
<% } %>
else
{
<%: Html.ActionLink("Home", "Index", "Home") %>
<%: Html.ActionLink("Assurancequalité", "AQ", "Home") %>
<%: Html.ActionLink("Control qualité","CQ", "Home">
}
loylmed at 10-Jan-13 3:30am
   
thx but how can i get a test with the userName???
because every user has her property tabs
Christian Graus at 10-Jan-13 15:09pm
   
Then you need to add code that pulls out the user name and checks it. Better yet, I would have a model that returned a list of tabs to show for the current user, and take the logic out of the cshtml. The cshtml should just know that it only shows tabs the view tells it to

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 589
1 OriginalGriff 379
2 CPallini 205
3 RyanDev 175
4 Sergey Alexandrovich Kryukov 170
0 OriginalGriff 5,649
1 Sergey Alexandrovich Kryukov 4,783
2 Peter Leow 2,954
3 Maciej Los 2,689
4 DamithSL 2,465


Advertise | Privacy | Mobile
Web02 | 2.8.140718.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid