I want to create a simple list of string in view, submitted from textbox, using submit button, without using model, using razor. I want that on every submit a new string in the list is created. I am trying the following code but it just creates one string in the list :
@{ ViewBag.Title = "Index"; } <h2>Index</h2> <form action="" method="post"> <p style="float:left;">Message: </p> <input type="text" name="message" style="float:left;" /> <br /><br /> <input type="submit" value="submit" /> </form> @{ var message = ""; if (IsPost) { message = Request["message"]; <p> @message </p><br /> } }