Click here to Skip to main content
Sign Up to vote bad
good
See more: ASP.NETMVC4
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:54
loylmed364

Comments
joshrduncan2012 - 3 Jan '13 - 15:15
What is the problem exactly?

1 solution

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 - 7 Jan '13 - 8:20
can u give me an example plz?
Christian Graus - 7 Jan '13 - 14:24
<% 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 - 10 Jan '13 - 3:30
thx but how can i get a test with the userName??? because every user has her property tabs
Christian Graus - 10 Jan '13 - 15:09
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
Your Filters
Interested
Ignored
     
0 Arun Vasu 339
1 OriginalGriff 320
2 Sergey Alexandrovich Kryukov 315
3 Tadit Dash 221
4 CPallini 178
0 Sergey Alexandrovich Kryukov 9,955
1 OriginalGriff 7,589
2 CPallini 4,028
3 Rohan Leuva 3,422
4 Maciej Los 2,949


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