I have something like this inside my View:
@String.Format("{0} © Copyright by Nemanja", DateTime.Now.Year);
However, this is escaping my &
into &
. Is there any way to bypass this?
You're looking for @Html.Raw(...)
, which will prevent that and create an XSS hole instead.
In your case, you can get rid of it entirely:
@DateTime.Now.Year © Copyright by Nemanja
You can:
@Html.Raw(String.Format("{0} © Copyright by Nemanja", DateTime.Now.Year));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With