Shane

Shane

  • NA
  • 3
  • 0

Display a textbox when checkbox is checked on webform

Apr 29 2009 3:21 PM
I am working in Visual Studio 2008 C# Asp.net. The Webpage is populated from the fields in the database through a databind. I am getting my information from a table in my database off of SQL Server 2005. The purpose of this Webform is for users to input information to be stored on the database. I only want to display a Textbox if the user clicks on the Checkbox. I was planning on doing this in the .CS with an IF Statement but the problem I am running into is when I double click the Checkbox and am in the Checkbox_CheckChanged method the Textbox and the Checkbox are both out of Scope. Do you have any suggestions to get the checkbox and textbox to display so I can write code behind it? Thank you!!

Answers (3)