Timeline for MVC Razor need to get Substring
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 19, 2020 at 8:00 | comment | added | CodeCaster |
This can break. DisplayFor() for a string by default returns an HtmlString, with the HTML-encoded string, but can also trigger a display template to be rendered, not all strings are rendered as plain strings. If the template returns more than the string, for example <span class="fancy-string">@Model</span>" , or if the input string contains HTML entities ("foo&bar" ), you now have partial HTML being printed. Using a separate model property that returns a substring is the way to go.
|
|
Apr 14, 2020 at 11:25 | comment | added | Kalin Krastev | Wouldn't that display a substring the namespace and type of FirstName? | |
Jan 5, 2013 at 15:30 | history | edited | David Robinson | CC BY-SA 3.0 |
deleted 18 characters in body
|
S Jan 5, 2013 at 15:29 | review | Late answers | |||
Jan 5, 2013 at 15:40 | |||||
S Jan 5, 2013 at 15:29 | review | First posts | |||
Jan 5, 2013 at 15:30 | |||||
Jan 5, 2013 at 15:13 | history | answered | Weslley Larentes | CC BY-SA 3.0 |