vendredi 3 mars 2017

Why If and Else two different conditions gives the same result?

SO, In a MVC razor view I do check if request is authenticated show A if request is not authenticated show B as here below:

@if (Request.IsAuthenticated)
{
   <a style='color: #000000; font-family:"Myriad عربي"; font-size:x-large' href="@Url.Action(Model.ActionName, Model.Controller)">
   @Model.ActionText
   </a>
}
else
{
   <a style='color: #000000; font-family:"Myriad عربي"; font-size:x-large' href="#">
   @Model.ActionText
   </a>
}

Although the condition block executes fine but in both condition I have the same result.

Aucun commentaire:

Enregistrer un commentaire