1

我正在尝试显示卢比符号:₹代码:₹;在我的锚标签中。

我已经尝试了一些东西,但没有任何效果......请帮助

        @{ string _text =
               String.Format("{0} {1} {2} {3} {4}",
               @Html.DisplayFor(model => model.NoOfBedrooms),
               "bedroom flat",
               @Html.DisplayFor(model => model.TransactionTypeDescription),
               @Html.Raw(₹),
               @Html.DisplayFor(model => model.Price));

           string _rental = "";
           if (Model.TransactionType == 2) { _rental = " per month"; } else { _rental = ""; };

           string _linkText = _text + _rental;
        }



@Html.ActionLink(_linkText, "Details", "Property", new { id = Model.PropertyId }, null)
4

1 回答 1

1

我不确定您是否可以Html.ActionLink使用<a href='@Url.Action("Index")'>@Html.Raw("&#8377")</a>.


@{ string _text =
           String.Format("{0} {1} {2} {3} {4}",
           @Html.DisplayFor(model => model.NoOfBedrooms),
           "bedroom flat",
           @Html.DisplayFor(model => model.TransactionTypeDescription),
           "&#8377;",
           @Html.DisplayFor(model => model.Price));

       string _rental = "";
       if (Model.TransactionType == 2) { _rental = " per month"; } else { _rental = ""; };

       string _linkText = _text + _rental;
    }

<a href='@Url.Action("Details", "Property", new { id = Model.PropertyId })'>
    @Html.Raw(_linkText)
</a>
于 2012-11-27T23:12:56.597 回答