Mark This Response as Answer -- Chandu http://www.dotnetfunda.com/images/dnfmvp.gif
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" language="javascript"> function enableTextBox() { if (document.getElementById("chkAssociation").checked == true) document.getElementById("txtAddress").disabled = false; else document.getElementById("txtAddress").disabled = true; } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:CheckBox Checked="false" OnChange="javascript:enableTextBox();" ID="chkAssociation" runat="server" /> <asp:TextBox ID="txtAddress" Enabled="false" Text="Test" runat="server" /> </div> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" .WebForm2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="tb1" runat="server"></asp:TextBox> <asp:CheckBox ID="CheckBox1" runat="server" oncheckedchanged="CheckBox1_CheckedChanged" AutoPostBack="True" /> </div> </form> </body> </html> using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; namespace { public partial class WebForm2 : System.Web.UI.Page { protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { if(CheckBox1.Checked==true) { tb1.Visible = true; } else { tb1.Visible=false; } } protected void Page_Load(object sender, EventArgs e) { tb1.Visible = false; } } }
If this post helps you mark it as answer Thanks
Login to post response