Another issue with modal popup. I have a form that is opened from a row in a grdview by passing an id to a stored proc that populates a datatable which, in turn, populates the from so the user can edit it.. The form- in the current iteration - is not a FormView, just a table with text boxes. It is enclosed in a panel that the modal popup shows. I tried using a form view previously, with the same negative results.
So what is happening is I show() the form and it opens OK, Then I retrieve the data into a datatable and assign it's values to the text boxes. When I debug you can see the datatable has the correct values, but when you assign them to text boxes they are blank? I do have the table wrapped in an update panel, but I am not doing anything with it right now.
This modal popup is very frustrating and I have not found much in the way of documentation?
Code behind:
protected void GridView1_RowCommand1(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Detail")
{
mpedetail.Show();
stats st = new stats();
int rideid = Convert.ToInt32(e.CommandArgument);
DataTable dt = new DataTable();
dt = st.getridedetail(rideid);
string rdte = dt.Rows[0]["ridedate"].ToString();
lblridedate.Text = rdte;
TextBox7.Text = "123.0";
}Even when I hard code the last line in it does not flll the text.
HTML:
<div><asp:Panel ID="pnldetail" runat="server" CssClass="modalPanel" Width="650" style="display:none;"><asp:Label ID="Label5" runat="server" Text="Ride Details"></asp:Label><br /><%--<asp:Panel ID="Panel2" runat="server" CssClass="modalPanel" Width="650" >--%><%--<asp:Label ID="Label5" runat="server" Text="Ride Details"></asp:Label>--%><table class="auto-style1"><tr><td class="tdrt_50"> </td><td colspan="6"><%--<asp:ValidationSummary ID="ValidationSummary1" runat="server" />--%></td></tr><tr><td class="tdrt_50"></td><td class="tdrt_100"><asp:Label ID="Label6" runat="server" Text="Ride Date:" /></td><td class="tdlt_150" colspan="2"><asp:Label ID="lblridedate" runat="server" CssClass="txlt_75" /><td class="tdrt_50"> </td><td class="auto-style2"><asp:Label ID="Label7" runat="server" Text="Temperature:" /></td><td class="auto-style3"><asp:TextBox ID="TextBox5" runat="server" CssClass="txrt_25" /> Hi <asp:TextBox ID="TextBox6" runat="server" CssClass="txrt_25" /> Lo <asp:DropDownList ID="DropDownList1" runat="server" OnDataBound="ddltempscale_DataBound" /></td></tr><tr><td class="tdrt_50"> </td><td class="tdrt_100"><asp:Label ID="Label8" runat="server" Text="Distance:" /></td><td class="tdlt_150" colspan="2"><asp:TextBox ID="TextBox7" runat="server" CssClass="txlt_75" /><asp:DropDownList ID="DropDownList5" runat="server"><asp:ListItem Value="I">Miles</asp:ListItem><asp:ListItem Value="M">km</asp:ListItem></asp:DropDownList> </td><td class="tdrt_50"> </td><td class="tdrt_100"><asp:Label ID="Label9" runat="server" Text="Elevation Gain:" /></td><td class="auto-style3"><asp:TextBox ID="TextBox8" CssClass="txrt_50" runat="server"></asp:TextBox> <asp:DropDownList ID="DropDownList6" runat="server"><asp:ListItem Selected="True" Value="I">Feet</asp:ListItem><asp:ListItem Value="M">Meters</asp:ListItem></asp:DropDownList></td></tr></table></asp:Panel> <ajaxToolkit:ModalPopupExtender ID="mpedetail" runat="server" PopupControlId="pnldetail"
Enabled="True" TargetControlID="Button4" BackgroundCssClass="modalBackground" /> <asp:Button ID="Button4" runat="server" Text="Button4" style="display:none;" />