Good evening. I was hoping someone can help me:
I have an ASP.NET page which contains an ArrayList bound to a
DataGrid. The DataGrid displays, in columns, a few members of the
objects in this ArrayList. Each object that is displayed (ie. each row
in the DataGrid) also has an "Add" and a "Remove" button. Think
Windows Update style here.
If you click the "Add" button, it becomes Disabled and the "Remove"
button is Enabled. Click on "Remove" and it becomes Disabled and the
"Add" button is Enabled. Just like Windows Update.
I manage that Enabling/Disabling with client side Javascript. I take
the Client ID and do a "btn1.disabled = true" (or false) on the button
objects.
When a "Submit" button is pressed, the server iterates through the
rows in the DataGrid and looks for buttons that are Enabled. This is
how the server would know which buttons you've enabled or disabled.
The problem is that the state that I set via JavaScript on the client
does not seem to make it back to the server.
Initially I have all the Add buttons enabled and all the Remove
buttons disabled. If I disable all the Adds, enable all the Removes,
the server still sees them all as Disabled. Any ideas why?