Reputation: 919
I am trying to show the rupee sign: ₹ code: ₹ ; in my anchor tag.
I have tried a few things but nothing works ... please help
@{ 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)
Upvotes: 1
Views: 3356
Reputation: 102753
I'm not sure you can do it with Html.ActionLink
, but you can always construct it manually by using <a href='@Url.Action("Index")'>@Html.Raw("₹")</a>
.
@{ string _text =
String.Format("{0} {1} {2} {3} {4}",
@Html.DisplayFor(model => model.NoOfBedrooms),
"bedroom flat",
@Html.DisplayFor(model => model.TransactionTypeDescription),
"₹",
@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>
Upvotes: 1