Problem with null char visualization in mvc editorfor RRS feed

  • Question

  • Hi,

    I have a form to insert a row in a db table.

    With an empty char (\0) in my textbox I see '�' .

    @Html.EditorFor(model => model.mychar, new { htmlAttributes = new { @class = "myStyle" } })

    How can I do?

    Thursday, May 23, 2019 4:43 PM

All replies

  • What did you expect to see?  ASCII 0 has no printable representation.

    How did you get a zero in there to begin with?  It is not generally found in text fields because it causes such problems with C code.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Thursday, May 23, 2019 4:58 PM
  • Hi

    Thank you for posting here.

    Since this thread is related to MVC, you could post in the following forum.

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, May 24, 2019 5:32 AM