468,114 Members | 1,921 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,114 developers. It's quick & easy.

diffrence between Asp:Textbox vs input text

Please Tell Me A Difference Between
Asp:Textbox vs input text
Sep 13 '19 #1
2 2327
84 64KB
The difference between Asp:Textbox and input text
Asp:Textbox is ASP.Net Controls and input text is HTML Controls so the main differnce between HTML Controls and ASP.Net Controls.

HTML Controls
HTML control runs at client side.
You can run HTML controls at server side by adding attribute runat=”server”.
HTML controls are client side controls, so it does not provide STATE management.
HTML control does not require rendering.
As HTML controls runs on client side, execution is fast.
HTML controls do not have any separate class for its controls.
HTML controls does not support Object Oriented paradigm.
Expand|Select|Wrap|Line Numbers
  1. Example:
  2. <input type="text"  ID="txtName">

ASP.Net Controls
ASP.Net controls run at server side.
You can not run ASP.Net Controls on client side as these controls have this attribute runat=”server” by default.
ASP.Net Controls are Server side controls, provides STATE management.
ASP.Net controls require rendering.
As ASP.Net controls run on server side, execution is slow.
ASP.Net controls have separate class for its each control.
With ASP.Net controls, you have full support of Object oriented paradigm.
Expand|Select|Wrap|Line Numbers
  1. Example:
  2. <asp:TextBox Id="txtName" runat="server">
  3.  </asp:TextBox>
Sep 20 '19 #2
Forget about server side controls in ASP.NET MVC. Everything containing runat="server" is a big NO in ASP.NET MVC. Won't work in Razor anyways. There are no pros and cons. Server side controls should never be used so there's nothing to compare. Simply use HTML helpers such as Html.EditorFor and Html.TextBoxFor.
Sep 23 '19 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by multimatum2 | last post: by
3 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.