Ok for sake of brevity I'm going to shorten the code so hopefully you
can see what I'm trying to do.
<asp:FormView ID="FormView1" runat="server" DataKeyNames="ID"
DataSourceID="SamplesDSource"
DefaultMode="Insert">
<InsertItemTemplate>
....
<tr>
<td>
<asp:Label ID="Label29" runat="server" Text="M2M
Shipping Address"></asp:Label></td>
<td colspan="2">
<hr style="width:100%" />
<input id="M2MShipAddresstxt" type="text"
disabled="disabled" style="width:340px" /><br />
<input id="M2MShipAddressIDtxt" type="hidden"
style="width:340px" value="" />
<a href="javascript:;" onclick="window.open
('M2MShippingPopup.aspx?
TextBox=M2MShipAddressIDtxt&ResultsBox=M2MShipAddresstxt','cal','width=550,height=225,left=270,top=180')">Select
Address ASP</a>
<hr style="width:100%" />
</td>
</tr>
....
<tr>
<td align="center" colspan="3">
<asp:Button ID="btnSubmit" runat="server"
Text="Submit" CommandName="Insert" CausesValidation="True"
OnClick="btnSubmit_Click" /></td>
</tr>
</table>
</InsertItemTemplate>
</asp:FormView>
Then in the popup window I have a gridview that runs this script when
the user selects a value (gvAddress_SelectedIndexChanged)
script(1) = "<script>window.opener.document.forms[0]." +
controlHdn.Value + ".value = '"
script(2) = gvAddress.SelectedDataKey.Value.ToString
script(3) = "';self.close()"
script(4) = "</" + "script>"
So the javascript takes the value from the gridview and on the parent
page it populates the:
<input id="M2MShipAddressIDtxt" type="hidden" style="width:340px"
value="" />
That all works correctly except I cannot read this input to add it to
the dictionary during the FormView1_ItemInserting event. I've tried
everything I can think of including
Request.Form("M2MShipAddressIDtxt")
and
FormView1.FindControl("M2MShipAddressIDtxt")
But the code will not see that hidden input or any HTML input no
matter what I do. I can get it to see asp.net inputs such as
asp:textbox but only if they're enabled and visible which kind of
defeats the point of a hidden input.
Thanks for the help!
-Tim