Jo Jo

Jo Jo

  • NA
  • 18
  • 6.2k

To hold the values when we go to next page of gridview

May 24 2017 2:37 AM

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, 
  1. $(document).off("click"".Link").on("click"".Link"function (e) {           
  2.         hiddenTicketId = $(this).attr("id");  
  3.         $(this).hide();  
  4.         $('.UnLink').hide();  
  5.         $('.Link').show();  
  6.         if (hiddenTicketId == $(this).attr("id")) {  
  7.             $($(this).closest("td").find(".Link")).hide();  
  8.             $($(this).closest("td").find(".UnLink")).show();  
  9.         }  
  10.     });    

Answers (3)