I am loading an HTML page in ajax modal on the click of a button inside a repeater.
$(".ajax-link").on('click', function (e) {
e.preventDefault();
$("html, body").addClass("hid-body");
$(".ajax-modal-overlay").fadeIn(400);
$(".ajax-modal-container").animate({
right: "0",
opacity: 1
}, 300);
$.ajax({
url: this.href,
success: function (html) {
$("#ajax-modal").empty().append(html);
initHiddenGal();
$(".ajax-modal-overlay , .ajax-modal-close").on('click', function () {
$("html, body").removeClass("hid-body");
$(".ajax-modal-overlay").fadeOut(100);
$(".ajax-modal-container").animate({
right: "-550px",
opacity: 0
}, 300);
setTimeout(function () {
$("#ajax-modal").empty();
$(".ajax-loader").fadeIn(100);
}, 300);
});
}
});
$(".ajax-loader").delay(700).fadeOut(400);
setTimeout(function () {
$(".ajax-modal-wrap").animate({
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">
<ItemTemplate>
<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>
<%--LinkButton--%>
<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>
</asp:LinkButton>
</div>
</article>
</div>
</ItemTemplate>
</asp:Repeater>
What I have tried:
I tried appending form again on close button of modal.
$(".ajax-modal-overlay , .ajax-modal-close").on('click', function () {
$(document.body).append("#aspnetForm");
But i am still getting the same error. Please Help.