I have a model passed into a cshtml view, and I'm trying to create a variable with a string from the model. The problem is that the string contains newlines, and when I create the variable, the newlines are not converted, and I end up with an Unterminated string constant
error in the Javascript.
Currently I'm doing this:
var something = @Model.string;
How can I pass the model attribute so that new lines are preserved in the javascript variable?