Get the viewbag break line data in the textarea property

Jul 15 2021 8:21 PM

Hi all,

I have the textarea property like, 

 <textarea class="form-control"  id="txtnotes"  rows="5" placeholder="Enter ..."></textarea>

I stored the data in the database. When I retrive the data, the value is like "test\ntest\n\ntest" because in textarea I gave the line break and saved the data. Now I get this data in the viewbag like "test\ntest\n\ntest" and then I try to set it in the textarea using jquery. In that, the given viewbag value was get as separated as shown in the below image. 

How to get the viewbag value as it is in the jquery and display it as with the line break?

Thanks.


Answers (2)