Click here to Skip to main content
15,067,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am loading an HTML page in ajax modal on the click of a button inside a repeater.

$(".ajax-link").on('click', function (e) {
               $("html, body").addClass("hid-body");
                   right: "0",
                   opacity: 1
               }, 300);
                   url: this.href,
                   success: function (html) {
                       $(".ajax-modal-overlay , .ajax-modal-close").on('click', function () {
                           $("html, body").removeClass("hid-body");
                               right: "-550px",
                               opacity: 0
                           }, 300);
                           setTimeout(function () {
                           }, 300);
               setTimeout(function () {
                       opacity: "1"
                   }, 300);
               }, 1000);
               return false;

after using the modal opening link, Other link buttons Clicks on the Main page gives the error as
Form submission canceled because the form is not connected

Repeater Code
<pre>    <pre lang="c#"><asp:Repeater ID="Site_Grid" runat="server" Visible="false" OnItemDataBound="Site_Grid_ItemDataBound" OnItemCreated="Site_Grid_ItemCreated" OnItemCommand="Site_Grid_ItemCommand">
            <div class="listing-item has_one_column">
                <article class="geodir-category-listing fl-wrap grid-item-holder">
                    <div class="geodir-opt-list">
                        <%--Ajax Link--%>
                        <a href="MediaPanel.aspx?<%#Eval("PageUrl") %>" class="geodir-js-favorite ajax-link">class="fal fa-eye"><span class="geodir-opt-tooltip">View Details</span></a>
                        <asp:LinkButton ID="LinkButton6" runat="server" CommandName="AddtoPlan" CommandArgument='<%# Eval("Id")%>' class="geodir-js-booking add" Text="Add">^__i class="fal fa-plus"><span class="geodir-opt-tooltip">Add</span>

What I have tried:

I tried appending form again on close button of modal.
 $(".ajax-modal-overlay , .ajax-modal-close").on('click', function () {

But i am still getting the same error. Please Help.
Updated 15-Jan-20 1:54am
ZurdoDev 15-Jan-20 10:24am
.append("#aspnetForm") will just append the text #aspnetForm. You need to append the form itself.
Sanjeev236 15-Jan-20 12:16pm
I tried the same but No Luck. :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900