diffrence between Asp:Textbox vs input text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vignesh2395
    New Member
    • Sep 2019
    • 1

    diffrence between Asp:Textbox vs input text

    Please Tell Me A Difference Between
    Asp:Textbox vs input text
  • AjayGohil
    New Member
    • Apr 2019
    • 83

    #2
    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.
    Code:
    Example:
    <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.
    Code:
    Example:
    <asp:TextBox Id="txtName" runat="server">
     </asp:TextBox>

    Comment

    • parth123
      New Member
      • Sep 2019
      • 4

      #3
      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 .

      Comment

      Working...