Get value from input html in codebehind c# Get value from input html in codebehind c# asp.net asp.net

Get value from input html in codebehind c#


Since it is running at the server...

txtNickname.Value and txtPassword.Value will give you what you need.

When you specify runat="server" you are essentially giving a property to your codebehind class. So you can access that property and it's properties directly.


Why not use a server control?

<asp:TextBox ID="txtNickname" runat="server" />

Code behind:

var nickName = txtNickname.Text;


string Nickname = txtNickname.Text;string Password = txtPassword.Text;

They're running on the server, see this