c# - How to select the value of a link button in gridview -


i have gridview trying select value of link button clicked on specific row of gridview. below code , erroring out due improper selecting of link button in gridview. please me in figuring out.

on page load error

asp.test_aspx not contain definition 'lnkview' , no extension method 'lnkview' accepting first argument of type 'asp.createsegment_aspx' found (are missing using directive or assembly reference?)

function:

 $(document).ready(function() {               if($('#<%=this.lnkview.clientid %>').length){               $('#this.lnkview').click(function(event) {                     event.preventdefault();                     $('#plnclone').dialog({                         modal: true,                         width: 550,                         height: 250,                         open: function(type, data) {                             $(this).parent().appendto("form");                         }                     });                 });             }              $('#cancelclone').click(function(event) {                 event.preventdefault();                 $('#plnclone').dialog('close');             });             //             if ($('#hfdcloneoffer').val() == "duplicate") {                 $('#plnclone').dialog({                     modal: true,                     width: 550,                     height: 250,                     open: function(type, data) {                         $(this).parent().appendto("form");                     }                 });                 //                 // scroll page top                 $('html, body').animate({ scrolltop: '0px' }, 800);             } 

the second line of code appears missing server tags.

$('#this.lnkview')  

should become

$('#<%=this.lnkview.clientid %>') 

edit looking @ markup, don't think you'll able lnkview.clientid on outside of grid row. suggest use put class on linkbutton , use selector instead.

more edit should work

<asp:linkbutton id="lnkview" runat="server" text="view" causesvalidation="false" cssclass="lnkviewclass">            $('.lnkviewclass').click(function(event) {                 event.preventdefault();                 $('#plnclone').dialog({                     modal: true,                     width: 550,                     height: 250,                     open: function(type, data) {                         $(this).parent().appendto("form");                     }                 });             });         } 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -