c# - How can the html encoding for a text box be disabled? -
i have troubles text box input control value on ascx page. it's value somehow html encoded, , don't know how can disabled. example when value contains <
character converted <
. strange thing is, happens on fields name.lastname
(which have child property). first thought caused html extension method
html.textboxfor(m => m.name.lastname, new { maxlength = "100" })
but not case, because when use html input directly, it's value still encoded:
<input id="name_lastname" maxlength="100" name="name.lastname" type="text" value="<%= model.name.lastname %>" />
does know how html encoding of text box values fields name.lastname
(with child property) can disabled?
after more research found out caused javascript function variables initialized using <%:
, , function used initialize text boxes. in end had nothing child properties. changed <%:
<%=
in javascript part:
var lastname = "<%: model.name.lastname %>";
in
var lastname = "<%= model.name.lastname %>";
Comments
Post a Comment