Background
Keeping the double backslash between server side and client side.
View Model
MyViewModel.Users { get "'domain\\user1', 'domain\\user2'"; }
Markup
On the page I output using:
var userArray = [ @Html.Raw(Model.Users) ];
Problem
viewing source shows:
var userArray = [ 'domain\user1', 'domain\user2' ];
This is causing errors. I want to keep the single quotes but double escape the backslash.
TIA….
Double escaping a backslash would be
"\\\\"in C#.This gives you an internal string that has two backslashes.