How to display a colon in this example between the output of the Label and the task.Count :

 @foreach (var task in Model.TaskComplitedByUser) { @Html.Label(task.Label) @task.Count } 

As a result, to get for example:

 <label for="">Текст</label>: 0 

So tried it does not work:

 @Html.Label(task.Label) @: @task.Count @Html.Label(task.Label) @:: @task.Count 

    1 answer 1

    option 1:

     @Html.Label(task.Label)<text>:</text> @task.Count 

    option 2:

     @Html.Label(task.Label) @Html.Encode(":") @task.Count 

    option 3:

     @Html.Label(task.Label) Write(":"); @task.Count 

    option 4:

     @Html.Label(task.Label) @":" @task.Count 
    • Works. Is this the only option for a colon? - koks_rs
    • will probably still work like this: @Html.Encode(":") - Ruslan_K
    • It should be noted that all these options are required only in C # code mode. In HTML mode, a simple colon works. - Pavel Mayorov