Last post Apr 18, 2008 10:39 PM by bradwoody
Apr 17, 2008 07:02 PM|bradwoody|LINK
ASP.Net and C#
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
- textbox – to enter search criteria
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:
but I can't get the checkboxes and radios.
access html controls from C# in code behind
Apr 17, 2008 07:26 PM|karan@dotnet|LINK
If you want to access any of your controls in code behind then you have to add runat="server" to your controls and then access them
Apr 17, 2008 07:50 PM|barryman9000|LINK
Apr 18, 2008 06:53 PM|bradwoody|LINK
Thanks for the response.
Apr 18, 2008 10:39 PM|bradwoody|LINK
Thanks for the suggestion. I suspected I would have to do that sooner or later. In fact, I'll probably start playing around this weekend.
As far as my original issue, two things resolved it:
Man, this is circuitous stuff for an old mainframe programmer...