First of all, you don't want to do this logic in a master page. You want to create a partial view that will build the menu based on the model information returned by a child action in some controller. For example:
You should move this logic into some controller that is in charge of building navigation. Inside of this controller you should declare a child action that returns the information that you need.
If you plan to store URL and Description in a database, you might as well store access privileges in a table as well. That way you can pass user's group or user name and retrieve a collection of URL to which that user has access. After that you could use a code similar to the one below.
For example:
public class NavigationController : Controller
{
[ChildActionOnly]
public PartialViewResult GetMenuForUser()
{
var model = _securityLayer.GetUrlForUser(HttpContext.User.Identity.Name);
return PartialView("_UserMenu", model);
}
}
Your _UserMenu.cshtml could be like:
@model IEnumerable<SomeCollection>
@foreach(var url in Model) {
<li><a class="ajax-link" href="@url.Url">@url.Description</a></li>
}
THen in your master page, where you want to use the menu you would call:
<div class="well nav-collapse sidebar-nav">
<ul class="nav nav-tabs nav-stacked main-menu">
<li class="nav-header hidden-tablet">MAIN MENU</li>
@{ Html.RenderAction("GetMenuForUser", "Navigation"); }
</ul>
</div>
This should give you an idea how to proceed regardless of whether you store user access rights in a database.
UPDATE: Sorry, I realized later that you are using ASPX View Engine and not Razor. You will need to convert to ASPX View Engine my markup.