0

In the view I would like to show the character new line in the input value '/n' If my json file like below:

"NotesTwo": [ { "Note": " Verification \n of income)" } ],

The character new line doesn't show.

I have tried to use @HTML.raw().

controller:

 public ActionResult Edit()
        {    
            var Response = System.IO.File.ReadAllText(Server.MapPath(JsonFileName));
            var _Loan = JsonConvert.DeserializeObject<List<Main>>(Response);

            return View(_Loan);
        }

View:

<input name="txtNoteOne_Note_@(conta7)" type="text" value="@Html.Raw(NotesOne.Note)"  />
anatp_123
  • 43
  • 6

1 Answers1

0

You need to escape the backslash with another backslash

"NotesTwo": [ { "Note": " Verification \\n of income)" } ],
Shloime Rosenblum
  • 927
  • 11
  • 26