i want to make basic form with one textarea. I want to pass message from textarea to MVC Controller.
This is my method in controller:
[HttpPost]
public ActionResult FromInput(string[] input)
{
var c = input.ToString();
return View("Succes");
}
And my Index.cshtml:
<div class="row">
<form id="form" action="/Home/FromInput" method="post">
<textarea name="input"> </textarea>
<br />
<input type="submit" id="submit_button" value="Submit" />
</form>
for now, my input variable in controller passed to function is string[1] array. In text area, i will have multiple line of texts. My question is, how to set every line of text from textarea to another place in input array? Is it possible?
For now, input var looks like this:
"One\r\nTwo\r\nThree"
Is it possible to put any line of text to another place in string array?