asp.net mvc - Can an mvc razor @helper return a non-encoded tag? -


It is contrived, but what I'm doing is basically like this I have a @bloper:

  @helper MyImage (int i) {string s = "& lt; img src = '{0}' / & gt;"; String theImage = ""; Switch (i) {Case 0: theImage = "test1.png"; break; Case 1: theImage = "test2.png"; break; Default: theImage = "error.png"; break; } String r = string.format (s, image); @ (R)}   

The output I get on the web page is definitely the actual string:

    

?

You can use @HTML @ (r) . Instead of (R)

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

memcached - Django cache performance -

java : convert string value to int -