Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outputting nbsp; in Razor via variables?

I am having a blank here.

I need to output "nbsp;" via a variable:

string strSpacer = "  ";

So was trying:

@:strSpacer

Does not work, although I do get the following in the page source:

 

What do I need to do to resolve this please?

like image 751
SamJolly Avatar asked Dec 18 '13 11:12

SamJolly


1 Answers

I think you're looking for @Html.Raw(strSpacer) See some more info about this function here: http://msdn.microsoft.com/en-us/library/gg480740%28v=vs.118%29.aspx

like image 76
Marthijn Avatar answered Sep 25 '22 18:09

Marthijn