ASP.Net and C#
I am having trouble determining how to manipulate html controls via javascript AND access those same controls in the C# code behind. Here's the scoop:
I am making an advanced search page, consisting of a table where each row has (in this order):
- checkbox – to indicate whether to return the column
- label
- textbox – to enter search criteria
On some rows, though, I replaced the textbox with radio buttons so users can search on True and False. At first I used ASP radio button controls, but I changed them to html controls so I could control them with javascript – so when the user UNchecks a checkbox, I want the corresponding radio buttons to both be unselected. So I made the checkbox and radios be html controls. Works great.
The problem: I'd like to build the SQL statement in C# in the code behind, but I don't know how to get the state of the html checkboxes and radio buttons to the code behind page.
I know I can do something similar to what I want if the html control is a textbox. I know I can access the value by:
Request["control's ID"].ToString()
but I can't get the checkboxes and radios.
Any suggestions?