Sunday, May 18, 2014

how to get read only textbox control values in codebehind using asp.net

1) protected void Page_Load(object sender, EventArgs e)
        {          
            txtbirthdate.Attributes.Add("readonly", "readonly");
        }

2) in button click event birthdate = txtbirthdate.Text;

3)  <asp:TextBox ID="txtbirthdate" runat="server" Width="183px" autocomplete="off"></asp:TextBox>
                <asp:CalendarExtender TargetControlID="txtbirthdate" runat="server">
                </asp:CalendarExtender>

No comments:

Post a Comment