The HtmlInputText class defines the methods, properties, and events for the HtmlInputText server control. This class allows programmatic access to the HTML <input type= text> and <input type= password> elements on the server.
Object
Control
HtmlControl
HtmlInputControl
HtmlInputText
[Visual Basic] Public Class HtmlInputText Inherits HtmlInputControl Implements IPostBackDataHandler [C#] public class HtmlInputText : HtmlInputControl, IPostBackDataHandler [C++] public __gc class HtmlInputText : public HtmlInputControl, IPostBackDataHandler [JScript] public class HtmlInputText extends HtmlInputControl, IPostBackDataHandler
[To be supplied.]
Namespace: System.Web.UI.HtmlControls
Assembly: System.Web.dll
This example demonstrates a simple authentication scenario. The HtmlInputButton class is also instantiated with the <input type=submit> element.
[Visual Basic]
<html> <script runat=server> Sub SubmitBtn_Click(Source As Object, E as EventArgs) If (Name.Value = "JohnDoe") And (Password.Value = "GoldFish") Then Message.InnerHtml = "You are authenticated!" Else Message.InnerHtml = "Login Failed!" End If End Sub </script> <body> <form method=post runat=server> <h3>Enter Name: <input id="Name" type=text size=40 runat=server> <h3>Enter Password: <input id="Password" type=password size=40 runat=server> <input type=submit value="Enter" OnServerClick="SubmitBtn_Click" runat=server> <h1> <span id="Message" runat=server> </span> </h1> </form> </body> </html>
HtmlInputText Members | System.Web.UI.HtmlControls Namespace