I have a HiddenField that I'm creating on a GridView's OnRowDataBound event:
var hF1 = new HiddenField();
e.Row.Cells[10].Controls.Add(hF1);
In JavaScript, I'm returning a value from a modal and setting the value on the HiddenField for that particular row, "hiddenField" being the ClientID of the HiddenField.
document.getElementById(hiddenField).value = settings;
Now, I have a Button.OnClick event where I need to capture that data for further processing, but I can't determine how I can retreive the data for the specific row.
foreach (SPGridViewRow dataRow in gvItems.Rows)
{
if (dataRow.RowType != DataControlRowType.DataRow) continue;
var mySettings = dataRow.... ?
How can I capture that value? Each value in the row's HiddenField control will be unique to that row. I'm also open to alternative storage of the temporary data held within this field on a per-row basis, just keep in mind that the data is returned from a JavaScript event.