autopostback not working my way
-
I want to only show a textbox when the clicks a checkbox, i use the autopostback and it shows the textbox, but i want it to hide it if the user deselects the checkbox, any help!!!
Ferron
-
I want to only show a textbox when the clicks a checkbox, i use the autopostback and it shows the textbox, but i want it to hide it if the user deselects the checkbox, any help!!!
Ferron
Hi, Heres the code protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.ControlVisible(); } } protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { ControlVisible(); } private void ControlVisible() { if (CheckBox1.Checked) { TextBox1.Visible = true; } else { TextBox1.Visible = false; } } Thx, Gayani
-
I want to only show a textbox when the clicks a checkbox, i use the autopostback and it shows the textbox, but i want it to hide it if the user deselects the checkbox, any help!!!
Ferron
protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { if (CheckBox1.Checked) { TextBox1.Visible = true; } else { TextBox1.Visible = false; } }