-1

I am trying to show the 'Account #' on label but code doesn't take it and I get error loading the MVC view. I changed that # sign to &num but then it shows as 'Account &num' What should I do to get 'Account #'

 <td class="element-label">@Html.LabelFor(model => model.AccountNumber, "Account Number") 
 </td>
2

1 Answer 1

0

There is a similar question below, ASP MVC Razor encode special characters in input placeholder

Where if you follow the link @Html.Raw might be the suitable way to get it to render if the encode/etc doesn't work.

Otherwise there are HTML entities that can be used to render what you want, like how it converted it to &num.

https://oinam.github.io/entities/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.