I have two buttons in gridview ,"Link and UnLink". When i click on 'Link' it should show 'UnLink' button. When we click a 'Link' button, now the button becomes' UnLink'. Then we navigate to the next page of gridview and return back to the parent page,the 'UnLink' button doesn't stay. It changes to 'Link' button. How I hold the 'Unlink' button on the page change of gridview.
And My code is,
- $(document).off("click", ".Link").on("click", ".Link", function (e) {
- hiddenTicketId = $(this).attr("id");
- $(this).hide();
- $('.UnLink').hide();
- $('.Link').show();
- if (hiddenTicketId == $(this).attr("id")) {
- $($(this).closest("td").find(".Link")).hide();
- $($(this).closest("td").find(".UnLink")).show();
- }
- });