I did some research and found out how I can read a value from the input html textbox.
This worked fine for me, but at once it doesn't work.
This is my code, it input html returns null
<input type="text" name="inpNickname" placeholder="Nickname" data-placement="right" data-toggle="tooltip" title="Nickname" id="txtNickname" runat="server"/>
<input type="text" name="inpPassword" placeholder="Password" data-placement="right" data-toggle="tooltip" title="Password" id="txtPassword" runat="server"/>
string Nickname = Request.Form["inpNickname"];
string Password = Request.Form["inpPassword"];
If I change the Request.Form[] to the ID's, it still doesn't work.
Solution 1. You can access the value of the control using Request object. Request["TextBoxID"] should give you the text in the textbox. Other option is - store the TextBox value in a Hidden Field onblur of the TextBox.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With