Here we will take a TextBox control and a submit button in view. On click of submit button we will capture the model class property value at controller end and read the text file append the user added value to the already added text.
     public class FileModel
    {  
        public string FileContent { get; set; }
    }  [HttpGet]
public IActionResult Index()
{
    FileModel fileModel = new FileModel();
    return View(fileModel);
} @model FileModel
@{
    ViewData["Title"] = "Home Page";
}
@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { @enctype = "multipart/form-data" }))
{
    <div style="color:red">@ViewBag.Message </div>
    <div style="font-weight:bold;">Enter Text:</div>
    <div>
        @Html.TextAreaFor(m => m.FileContent, new { @class = "form-control" })
    </div>
    <br />
    <div><input type="submit" value="Submit" /></div>
} [HttpPost]
public IActionResult Index(FileModel fileModel)
{
    try
    {
        string parentPath = @"wwwroot\Demofiles\";
        string texttfilename = "demotextfile.txt";
        string textfilepath = Path.Combine(Directory.GetCurrentDirectory(), parentPath, texttfilename);
        System.IO.File.AppendAllText(textfilepath, fileModel.FileContent + Environment.NewLine);
        ViewBag.Message = "Text data append completed successfully.";
    }
    catch (Exception ex)
    {
        ViewBag.Message = ex.Message;
    }
    return View();
} Now click on Submit button we will hit the break point and here at controller end we will get the user entered value in model class property.
Now press F5 to complete the code execution. 
Let's check the text file content.






