Can an MVC2 or MVC3 html.routelink contain &laquo and &raquo?
Asked Answered
R

2

6

What's the syntax for displaying this? My program will always render « literally in the pagination helper I am creating, and since the switch to MVC3 there seems to be no way to even hack it with Eval( string.FromCharCode )

Reames answered 27/1, 2011 at 15:12 Comment(0)
O
13

Just use the corresponding UTF-8 character and the HTML helper will take care of the encoding it:

@Html.RouteLink("«", new { action = "navigate", page = 1 })
@Html.RouteLink("»", new { action = "navigate", page = 3 })
Outage answered 27/1, 2011 at 15:16 Comment(0)
E
1

As long as you are using UTF-8 as your character-set then showing the « directly (without encoding it) is perfectly valid XHTML.

Elsi answered 27/1, 2011 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.