+4  A: 

If you intend to insert the string into the HTML markup then you need to HTML encode it:

<%= Html.Encode("',&@#'") %>

or if you are using ASP.NET 4.0:

<%: "',&@#'" %>

Doing this will properly encode any characters in the string.

Darin Dimitrov
I have tried that, but it returns the code instead of the character.
PlayKid
Precisely, isn't what you were looking for?
Darin Dimitrov