Hello all. I am fairly new to ASP.NET. I managed to get most of my application/site working. I am using “C#” and asp.net 2.0. I am having one problem that I can’t get around.
I have seen several posts and just can’t get it. I am using gridview to display several rows of data from an Odbc datasource. Each row in the grid needs a checkbox in the first column.
The idea is that the user can select 0 or more checkboxes and then click a submit button that will grab the values out of the rows that have the checkboxes selected.
However, when I click a checkbox the page reloads and everything looks like it did before I clicked the checkbox. The clicked action never seems to take affect.
I’m hoping someone can give me the code needed in the aspx page and in the cs page. Here is what I have thus far:
ASPX Page:
…
…
CS File:
…
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
CheckBox checkbox = (CheckBox)sender;
checkbox.Checked = true;
GridViewRow row = (GridViewRow)checkbox.NamingContainer;
}
…
Any help is greatly appreciated.