Note that there are some explanatory texts on larger screens.

plurals
  1. POAsp ModalPopupExtender not displaying detail view
    primarykey
    data
    text
    <p>I am using a ModalPopupExtender within an updatePanel to show a detailView when a user selects a "Details" Button within a GridView.</p> <p>The problem is that when the button is selected the popup is not being displayed. I have stepped through the code and the mdlPopup.Show() method is being executed but the popup does not "Show" Could someone perhaps help me out with what is happening? Here is my Code:</p> <pre><code>&lt;asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetRequests" TypeName="RequestDAL" SortParameterName="SortExpression"&gt;&lt;/asp:ObjectDataSource&gt; &lt;asp:ObjectDataSource ID="ObjectDataSourceDetails" runat="server" SelectMethod="GetRequestsDetail" OnSelecting="OdsDetail_Selecting" TypeName="RequestDAL"&gt;&lt;/asp:ObjectDataSource&gt; &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="RequestID" DataSourceID="ObjectDataSource1" EnableModelValidation="True" AllowSorting="True" CellPadding="10" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="gv_SelectedIndexChanged"&gt; &lt;AlternatingRowStyle BackColor="White" /&gt; &lt;Columns&gt; &lt;asp:CommandField ShowSelectButton="True" /&gt; &lt;asp:BoundField DataField="DateSubmit" HeaderText="DateSubmit" SortExpression="DateSubmit" /&gt; &lt;asp:BoundField DataField="Name" HeaderText="Name" SortExpression="lName" /&gt; &lt;asp:BoundField DataField="FirstDate" HeaderText="Date" SortExpression="FirstDate" /&gt; &lt;asp:BoundField DataField="BeginTime" HeaderText="Begin Time" SortExpression="beginTime" /&gt; &lt;asp:BoundField DataField="EndTime" HeaderText="End Time" SortExpression="endTime" /&gt; &lt;asp:BoundField DataField="Lab" HeaderText="Lab" SortExpression="room" /&gt; &lt;asp:BoundField DataField="ClassName" HeaderText="Class" SortExpression="Class" /&gt; &lt;asp:BoundField DataField="Semester" HeaderText="Semester" SortExpression="term" /&gt; &lt;asp:BoundField DataField="RequestID" HeaderText="RequestID" SortExpression="id" /&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;asp:LinkButton ID="btnDetails" runat="server" Text="Details" CommandName="Select" /&gt;&lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;EditRowStyle BackColor="#2461BF" /&gt; &lt;FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt; &lt;HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt; &lt;PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /&gt; &lt;RowStyle BackColor="#EFF3FB" /&gt; &lt;SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /&gt; &lt;/asp:GridView&gt; &lt;asp:Panel ID="pnlPopup" runat="server" Style="display: none" Width="500px"&gt; &lt;asp:UpdatePanel ID="updatePnlRequestDetail" runat="server" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:Button ID="btnShowPopup" runat="server" Style="display: none" /&gt; &lt;Ajax:ModalPopupExtender ID="mdlPopup" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlPopup" CancelControlID="btnClose" BackgroundCssClass="modalBackground" /&gt; &lt;asp:Label ID="lblRequestDetail" runat="server" Text="Request Detail" BackColor="LightBlue" Width="95%"&gt;&lt;/asp:Label&gt; &lt;asp:DetailsView ID="dvRequestDetail" DataSourceID="ObjectDataSourceDetails" runat="server" DefaultMode="Edit" Width="95%" BackColor="White" Visible="false"&gt; &lt;Fields&gt; &lt;asp:BoundField HeaderText="Id" DataField="RequestID" /&gt;&lt;/Fields&gt; &lt;/asp:DetailsView&gt; &lt;asp:LinkButton runat="server" ID="btnClose" Text="Close" CausesValidation="false"&gt;&lt;/asp:LinkButton&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;/asp:Panel&gt; protected void gv_SelectedIndexChanged(object sender, EventArgs e) { //show the detail view to render dvRequestDetail.Visible = true; // force the databinding dvRequestDetail.DataBind(); // update the detail panel updatePnlRequestDetail.Update(); //show the popup mdlPopup.Show(); } protected void OdsDetail_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { try { e.InputParameters["id"] = Convert.ToString(this.GridView1.DataKeys[this.GridView1.SelectedIndex].Value); } catch(Exception ex) { throw new Exception(ex.Message); } } </code></pre> <p>This is all taken from a tutorial I found for using Modal Popup extenders with ObjectDataSources <a href="http://mattberseth.com/blog/2008/04/masterdetail_with_the_gridview.html" rel="nofollow noreferrer">http://mattberseth.com/blog/2008/04/masterdetail_with_the_gridview.html</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload