c# - Authentication and navigation bar -
i set menu navigation on left side of page shown after user logs in.
i don't know how can accomplish mvc4 websecurity class , razor in index.cshtml file.
try using 2 layout:
_layout.cshtml non login user and
_memberlayout.cshtml login user. set fellow member menu in _memberlayout.
/home/index controller:
public actionresult index() { if (user.identity.isauthenticated) { homecoming redirecttoaction("index", "member"); } homecoming view(); }
/member/index controller:
[authorize] public actionresult index() { homecoming view(); }
index.cshtml in fellow member folder:
@{ viewbag.title = "member area"; layout = "~/views/shared/_memberlayout.cshtml"; } <div> ... fellow member html code </div>
c# asp.net asp.net-mvc
No comments:
Post a Comment