locked
modalpop Extender not popup RRS feed

  • Question

  • User29410129 posted
                <div id="myprofilepost" style="border:2px solid #d1d7d7; overflow-x:hidden; overflow-y:scroll; height:600px">
                    <asp:Label ID="lbl_error_msg" runat="server" ForeColor="SlateGray" Font-Bold="true"></asp:Label>
                    <div style="margin-left:20px">
                    <asp:Repeater ID="rptr_my_post" runat="server" OnItemCommand="rptr_my_post_ItemCommand">
                        <HeaderTemplate>
    
                        </HeaderTemplate>
                        <ItemTemplate>
                            <div id="textualPart">
                                <h4 style="float:left"><asp:LinkButton ID="lnk_btn_resource_title" runat="server" Text='<%#Eval("share_Resource_Title").ToString().Substring(0, Math.Min(Eval("share_Resource_Title").ToString().Length, 50)) %>'  CommandName="Preview" CommandArgument='<%# Eval("share_Resource_ID") %>'></asp:LinkButton> </h4> <h4 style="float:right; margin-right:10px; font-size:14px"><asp:Label runat="server"  Text='<%#Eval("privacy_Type_Name") %>'></asp:Label> <asp:LinkButton ID="lnk_btn_edit_post" runat="server" title="Edit" CommandName="Edit" CommandArgument='<%# Eval("share_Resource_ID") %>'><img src="Images/edit_icon.png" height="25" width="25" style="background-color:transparent; height:25px; width:25px; margin-bottom:10px" /> </asp:LinkButton>
                                    <Ajax:ModalPopupExtender  ID="mdlpopup_edit" runat="server" TargetControlID="lnk_btn_edit_post" PopupControlID="Panel2" BackgroundCssClass="modalBackground"  CancelControlID="btn_cancle"></Ajax:ModalPopupExtender>
    
    
                                <h5 style="width:250px; float:left;color:#f67e0a" > <b> Field:</b> <asp:Label ID="lbl_field" runat="server" Text='<%#Eval("field_Name") %>' Font-Size="12"></asp:Label></h5> <h5 style="width:250px; float:left; margin-left:20px;color:#f67e0a"><b> IdeaTye: </b><asp:Label ID="lbl_idea_type" runat="server" Text='<%#Eval("share_Type_Name") %>' Font-Size="13"></asp:Label></h5><br /><br />
    
                                <h6><asp:Label ID="lbl_description" runat="server" Text='<%#Eval("share_Resource_Description") %>' Style="font-size:16px; font-family:Calibri" ></asp:Label> </h6><br />
                                <img src="Images/doted_border.png" width="500" style="margin-left:50px" />
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                        
                 <asp:Panel  ID="Panel2" runat="server" CssClass="modalPopup" Align="Top" Style="display:none" >
                          <asp:Label ID="Label1" runat="server"></asp:Label>
                            <div class="form-group">
                                <div class="col-lg-10">
                                    <asp:TextBox ID="tb_edit_share_idea_title" runat="server" CssClass="form-control" ForeColor="Black" MaxLength="80"></asp:TextBox>
                                </div>
                            </div><br /><br />
                            <div class="form-group">                          
                                <div class="col-lg-10">
                                    <asp:DropDownList ID="ddl_edit_share_idea_type" runat="server" CssClass="form-control ddl" Width="400">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>                              
                                </div>
                            </div><br /><br />
                           <div class="form-group">                          
                                <div class="col-lg-10">
                                    <asp:DropDownList ID="ddl_edit_study_area" runat="server" CssClass="form-control ddl" Width="400">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>                              
                                </div>
                            </div><br /><br />
                           <div class="form-group">                          
                                <div class="col-lg-10">
                                    <asp:DropDownList ID="ddl_edit_privacy" runat="server" CssClass="form-control ddl" Width="400">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>                              
                                </div>
                            </div>
    
                            <div class="form-group">
                                <div class="col-lg-10"> 
                                    <asp:TextBox ID="tb_edit_share_idea_description" runat="server" placeholder="Description" TextMode="MultiLine" Rows="3" CssClass="form-control" ForeColor="Black"></asp:TextBox>
                                </div>
                            </div>
                      
                                <div class="form-group">
                                    <div class="col-lg-10 col-lg-offset-2">
                                        <asp:Button ID="btn_update_post" runat="server" CssClass="btn btn-primary" Text="Share" OnClick="btn_update_post_Click" />      
                                        <asp:Button ID="btnCancel" runat="server" CssClass="btn btn-warning" Text="Cancel" />                     
                                    </div>
                                </div>
                                 
                                               
              </asp:Panel>         
                    </div>
                </div>

    Modalpop Extender not pop when i clicked on edit button. Tell me what's wrong with me code? Waiting for your reply

    Friday, June 17, 2016 6:14 AM

Answers

  • User-2057865890 posted

    Hi DanyalHaider,

    Uncaught Sys.ArgumentNullException: Sys.ArgumentNullException: Value cannot be null. Parameter name: elements

    This might be caused by the id used in your code isn't right. Make sure the TargetControlID is correct.

    <asp:LinkButton ID="lnk_btn_edit_post" runat="server" title="Edit">Popup</asp:LinkButton>
    <ajaxToolkit:ModalPopupExtender ID="mdlpopup_edit" runat="server" TargetControlID="lnk_btn_edit_post" 
    PopupControlID="Panel2" CancelControlID="btn_cancle"> </ajaxToolkit:ModalPopupExtender>

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 25, 2016 7:32 AM

All replies

  • User-2057865890 posted

    Hi DanyaHaider,

    Modalpop Extender not pop when i clicked on edit button.

    Any error message? When you use ASP.Net AJAX ModalPopupExtender Modal Popup, you need a ScriptManager control.

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

    reference: Building Modal Popup using ASP.Net AJAX ModalPopupExtender Control

    Best Regards,

    Chris

    Friday, June 17, 2016 8:11 AM
  • User29410129 posted

    Any error message

    No, error message found

    Friday, June 17, 2016 9:47 AM
  • User29410129 posted

    already added in master page

    Friday, June 17, 2016 9:52 AM
  • User29410129 posted

    l already added this scriptManager tag in master, should i required in inherit pages?

    Friday, June 17, 2016 9:55 AM
  • User-2057865890 posted

    Hi DanyalHaider,

    You could remove scriptManager in master and add it to the current page. Check this sample

    <form id="form1" runat="server">
            <div>
                <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                <asp:Repeater ID="rptCustomers" runat="server">
                    <HeaderTemplate>
                        <table cellspacing="0" rules="all" border="1">
                            <tr>
                                <th scope="col" style="width: 80px">Customer Id
                                </th>
                                <th scope="col" style="width: 120px">Customer Name
                                </th>
                                <th scope="col" style="width: 100px">Country
                                </th>
                                <th scope="col" style="width: 100px">Popup</th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <asp:Label ID="lblCustomerId" runat="server" Text='<%# Eval("CustomerId") %>' />
                            </td>
                            <td>
                                <asp:Label ID="lblContactName" runat="server" Text='<%# Eval("ContactName") %>' />
                            </td>
                            <td>
                                <asp:Label ID="lblCountry" runat="server" Text='<%# Eval("Country") %>' />
                            </td>
                            <td>
                                <asp:LinkButton ID="lnk_btn_edit_post" runat="server" title="Edit">Popup</asp:LinkButton>
                                <ajaxToolkit:ModalPopupExtender ID="mdlpopup_edit" runat="server"
                                    TargetControlID="lnk_btn_edit_post" PopupControlID="Panel2" CancelControlID="btn_cancle">
                                </ajaxToolkit:ModalPopupExtender>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
    
                <asp:Panel ID="Panel2" runat="server" CssClass="modalPopup" align="center" Style="display: none">
                    popup
                    <asp:Button ID="btn_cancle" runat="server" Text="Close" />
                </asp:Panel>
            </div>
        </form>

    Code behind

            protected void Page_Load(object sender, EventArgs e)
            {
                if (!this.IsPostBack)
                {
                    this.BindRepeater();
                }
            }
    
            private void BindRepeater()
            {
                DataTable dt = new DataTable();
    
                dt.Columns.AddRange(new DataColumn[3] { new DataColumn("CustomerId", typeof(int)),
                                new DataColumn("ContactName", typeof(string)),
                                new DataColumn("Country",typeof(string))});
    
                dt.Rows.Add("1", "TestA", "A");
                dt.Rows.Add("2", "TestB", "B");
                dt.Rows.Add("3", "TestB", "C");
                dt.Rows.Add("4", "TestB", "D");
    
                rptCustomers.DataSource = dt;
                rptCustomers.DataBind();
            }

    Best Regards,

    Chris

    Saturday, June 18, 2016 8:32 AM
  • User29410129 posted

    I removed

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> from master page and add at current page but it's popping up. but i found errors when i checked my page inspect element. 

    when i clicked on edit button then error listed in my error log. 

    ScriptResource.axd?d=yeSNAJTOPtPimTGCAo3LlaRs7sFTQjE1M02bAMg0RFakNmMr-tW50ETsPIukwNJObS1F9fXgrpjsYf…:847 Uncaught Sys.ArgumentNullException: Sys.ArgumentNullException: Value cannot be null.
    Parameter name: elements



    Monday, June 20, 2016 7:08 AM
  • User-2057865890 posted

    Hi DanyalHaider,

    Uncaught Sys.ArgumentNullException: Sys.ArgumentNullException: Value cannot be null. Parameter name: elements

    This might be caused by the id used in your code isn't right. Make sure the TargetControlID is correct.

    <asp:LinkButton ID="lnk_btn_edit_post" runat="server" title="Edit">Popup</asp:LinkButton>
    <ajaxToolkit:ModalPopupExtender ID="mdlpopup_edit" runat="server" TargetControlID="lnk_btn_edit_post" 
    PopupControlID="Panel2" CancelControlID="btn_cancle"> </ajaxToolkit:ModalPopupExtender>

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 25, 2016 7:32 AM