Hy!
I want to show the text from the input after the submit on the beginning of the page
My Code:
@{
ViewBag.Title = "Login";
}
@{
if (ViewData["uname"]!=null )
{
<div>
Username: @ViewData["uname"] //The Text from the input should be displayed here after submit
@Session["uname"] = @ViewData["uname"]
</div>
}
}
<h2>Login</h2>
<h4>Username:</h4>
<input type="text" name="uname" value="" /> //Input
<button />
When i press the button nothing occurs. The Text from the input should appear abouth. The standard type of the button is submit.
Try this:
This uses an HtmlHelper to create the
<form />tags surrounding, so on submit it should post.