Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Difference between disabled and read only attributes

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 265
    Comment on it

    In Many cases, we required to display controls text in non-editable mode. We can attain this by setting read-only or disabled attribute of control fields.

     

    Disabled attribute

    • Disabled form fields or elements values don’t post to the server.
    • Disabled form fields or elements don’t get focus.
    • Disabled form fields or elements are skipped while navigation.
    • Browsers provide default style.

     

    Read Only Attribute

    • Read Only form fields or elements values post to the server.
    • Read Only form fields or elements get focus.
    • Read Only form fields or elements are included while navigation.
    • Some browsers do not provide default style for Read-Only form fields or elements.

     

    Set Disabled Attribute ASP.NET TextBox

     <asp:TextBox ID="txtDisabled" Enabled="false" runat="server"></asp:TextBox> 
    

    HTML Input

    <input name="txtDisabled" type="text" id="txtDisabled" disabled="disabled"/> 
    

     

    Set Read Only Attribute ASP.NET TextBox

     <asp:TextBox ID="txtReadonly" ReadOnly="true" runat="server"></asp:TextBox> 
    

    HTML Input

    <input name="txtReadonly" type="text" id="txtReadonly" readonly="readonly"/> 
    
    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: