MVC: Conditionally Display View link

Please see my other MVC articles.

Displaying Links Based on IF Logic

This article illustrates how to conditionally display a link within an MVC based on the results of an IF statement

1.MVC--Conditionally-display-View-link

As you can see in my View’s HTML, I am displaying a “Home” link and then, if the current user is part of the Administrator role, display a link to the “Admin” page, calling the default (Index) function for that controller. If the user’s current identity does not pass the test, nothing occurs.
2.MVC--Conditionally-display-View-link

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s