1
votes

Does the HTML controls in ASP.NET works in server side as well as client side? or it is for client side only?

1
Usually when you use the HTML controls like <input type="text" or <select , you want to submit some data to the server, it will work in asp.net as long as you have submit button and form containing these controls - Monah
ASP.NET is completely a server side technology. Pages are generated at the server and sent back to the user. The pages sent back to the user are static. The only way you can get client side functionality in a browser is by using javascript - Nick.McDermaid
@Monah ok , i want to submit this data to the server , so we consider it only as server or client ? - Mohammed Ali
when you assign an id to each of the html controls, you will be able to access this control from code behind of the page "server side", for your question (it depends on the way you are using them, if you are using jQuery for example to submit the data then it is client side, and if you want to use the submit button and you handle the data from code behind, then it will be server side.) - Monah
and you need to put runat="server" in order to be accessible from the server - Monah

1 Answers

2
votes

According to your Answer it Runs At Client side only if dont want to put runat='server' inside the html control tag.
HTML controls

HTML controls are the native browser elements and they are part of HTML language. These are client side controls which is accessible only in the HTML page, so it will improve the performance of the web page. HTML controls on an ASP.NET Web page are not available to the web server.

HTML Server controls

You can add the attribute runat="server" to any HTML control, such cases it will be an HTML server control. These controls map directly to html tags and without runat="server" it cannot access the control in code behind.

Web Server Controls or ASP.NET controls

Web Server Controls are group of controls derived directly from the System.Web.UI.WebControls base class. They are executed on the server side and output HTML sent back to the client browser. These controls are programmable and reusable that can perform function as the ordinary HTML controls. Web Server Controls can detect the target browser's capabilities and render themselves accordingly.