ASP.NET HTML Server ControlsHTML server controls are HTML elements that contain attributes to accessible at server side. By default, HTML elements on an ASP.NET Web page are not available to the server. These components are treated as simple text and pass through to the browser. We can convert an HTML element to server control by adding a runat="server" and an id attribute to the component. Now, we can easily access it at code behind. Example All the HTML Server controls can be accessed through the Request object. HTML ComponentsThe following table contains commonly used HTML components.
ExampleHere, we are implementing an HTML server control in the form. // htmlcontrolsexample.aspx This application contains a code behind file. // htmlcontrolsexample.aspx.cs Output: When we click the button after entering text, it responses back to client. Next TopicASP.NET CompareValidator |