C#C
C#3y ago
5 replies
Cheetah

❔ How do i make user input text appear

  public IActionResult ToDo(string Input)
        {

            Input = ViewBag.UserInput;
            ViewBag.UserInput = Input;
            return View();
        }

@page
@model Webthing.Views.Home.To_doModel

<h1>This is your To Do page</h1>



<form method="post" asp-action="ToDo">
    <input type="text" name="Input" /> <!-- Change name to "input" -->
</form>

<center><p>@ViewBag.UserInput</p></center>


this is part of my code rrelating to this so like how do i make UserInput appear on the website? im using cshtml
Was this page helpful?