When solving a problem in aspx, I got stuck while setting a database property from an ASP.Net session variable.
I want to set a property with a value that contains "\ u" in the character between them. how
App.prop.set("Username",<%= Session.Name %>)
Session.Name contains the value "john \ udenver" as the value. When I put the debugger in javascript and check the value that it selected \ u correctly, like "john \ udenver"
Thus, Session.Name already has an escape value of "john \ udenver".
But when it renders and tries to assign a value to the property, it is unescaping \ u and I get an exception saying "Error: expected hexadecimal digit".
I tried to escape using the "escape" method
App.prop.set("Username", escape ("<%= Session.Name %>"))
but it throws the same exception, it displays as
App.prop.set("Username", escape ("john\udenver"))
, "john\udenver" .
RegEx <% = Session.Name% > .
App.Prop.set("Username","<%= System.Text.RegularExpressions.Regex.Escape(Session.Name)%>");
, , .
\u \x, . .
.