Good afternoon,
I am currently working on a program where I have a modal popup prompting for updating parameters.
The aspx code for the popup looks like this:
<ajaxToolkit:ModalPopupExtender ID="mdlPopUpParameterUpdate" runat="server"
PopupControlID="pnlUpdateParameters"
TargetControlID="lblPopUpUpdateParameters"
CancelControlID="btnCancelUpdateParameters"
BackgroundCssClass="modalBackground"></ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="pnlUpdateParameters" runat="server" CssClass="modalContacts">
<div id="dvUpdateParametersGroupHeader">
<asp:Label ID="lblUpdateParametersHeader" runat="server"></asp:Label>
</div>
<div id="dvUpdateParametersGroupBody">
<div id="dvParamUpdateTable" runat="server" style="max-height: 600px; min-height:200px; overflow: auto">
<table style="width: 500px; height: 500px" id="tblUpdateParameters" runat="server">
</table>
</div>
<asp:Button ID="btnUpdateUpdateParameters" runat="server" Text="Update Panel" OnClick="btnUpdateUpdateParameters_Click" />
<asp:Button ID="btnCancelUpdateParameters" runat="server" Text="Cancel" />
</div>
</asp:Panel>
The function that includes mdlPopUpParameterUpdate.Show() sweeps through data in another spot on the page and creates the html rows for tblupdateparameters ... (tblUpdateParameters.Rows.Add(tr);)
This part works fine. Where I have a problem is when I click on the Update Panel button.
It calls the following function:
protected void btnUpdateUpdateParameters_Click(object sender, EventArgs e)
{
int k = 0;
k = tblUpdateParameters.Rows.Count;
...
My problem is that the count of rows for the table is reading 0. It's almost as if the html table is cleared immediately when the button is clicked. How do I get that data.
When I tried clicking the button, I got an error because it could not find the specific fields that I'm looking for. What I want to have happen is I want to read the html table so I can update the fields on the page and rewrite the data based on the updated fields.