Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 )

like image 287
whoblitz Avatar asked Jan 27 '11 15:01

whoblitz


2 Answers

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 })
like image 96
Darin Dimitrov Avatar answered Nov 17 '22 02:11

Darin Dimitrov


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

like image 36
Dan Diplo Avatar answered Nov 17 '22 02:11

Dan Diplo