How to dynamically change the visibility of label in mvc3?

I have the following code

<div> @Html.LabelFor(m=>m.WrongLogin) </div>   

I want to display the label dynamically based on a condition from the server side code in the controller. If the controller returns false value then I need to make the label visible.

Jon Skeet
people
quotationmark

Just use an if statement:

@if (Model.LoginFailed) // Or whatever...
{
    @Html.LabelFor(m => m.WrongLogin);
}

people

See more on this question at Stackoverflow