Skip to content
Loading
loop through to find the control and apply to class    
  •                     class="modal-body">  
  •                         ....... "margin-right: 29px">    
  •                             "btnpickbook" Text="" runat="server">    
  •                                 "Label59" runat="server" Text="" Font-Size="42px" CssClass="fa fa-book">    
  •                                 
  •                             "#" id="">"margin-right: 29px">"#" id="btnpickcup">    
  •                                 "Label7" runat="server" Text="" Font-Size="42px" CssClass="fa fa-coffee"    
  •                                     ForeColor="Red">    
  •                             "margin-right: 29px">"#" id="btnpen">    
  •                                 "Label8" runat="server" Text="" Font-Size="42px" CssClass="fa fa-pencil ">    
  •                                 
  •                         
  •                     class="modal-footer">    
  •                         
  •                     
  •                     
  •                 
  •                 
  •             
  •             
  •     
  •                   
  •       
  •     "text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">    
  •    "../Script/default%20css/AdminLTE-2.2.0/bootstrapDefault/js/bootstrap.min.js">    
  •     
  • "stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />    
  •   'text/javascript'>    
  •         $(function () {    
  •             var lblPick;    
  •             var lbliconam;    
  •             $('[id*=btnPick]').on('click', function () {    
  •                 lblPick = $(this).closest('tr').find('[id*=lblpickdefaultshow]');    
  •                 lbliconam = $(this).closest('tr').find('[id*=Label277]');    
  •                 var username = $(this).closest('tr').find('[id*=Label1]').text();    
  •                 var postId = $(this).closest('tr').find('[id*=lbCOMlId2]').text();    
  •                 //var postId = "106";    
  •                 $('[id*=hfUserName]').val(username);    
  •                 $('[id*=hfPostId]').val(postId);    
  •                 $('[id*=pickermodal]').modal('show');    
  •                 return false;    
  •             });    
  •     
  •             $('[id*=pickermodal] a').click(function () {    
  •                 var icon = '';    
  •                 var iconName = '';    
  •                 var userName = $('[id*=hfUserName]').val();    
  •                 var postId = $('[id*=hfPostId]').val();    
  •                 if ($(this).find('[id*=Label59]').length > 0) {    
  •                     icon = 'fa fa-book';    
  •                     iconName = 'Book';    
  •                 }    
  •                 else if ($(this).find('[id*=Label7]').length > 0) {    
  •                     icon = 'fa fa-coffee';    
  •                     iconName = 'Cup';    
  •                 }    
  •                 else if ($(this).find('[id*=Label8]').length > 0) {    
  •                     icon = 'fa fa-pencil';    
  •                     iconName = 'Pen';    
  •                 }    
  •                 $.ajax({    
  •                     type: "POST",    
  •                     url: "CS.aspx/INSERTUSERSTATUS",    
  •                     data: '{icon:"' + icon + '",iconName:"' + iconName + '",userName:"' + userName + '",postId:"' + postId + '"}',    
  •                     contentType: "application/json; charset=utf-8",    
  •                     dataType: "json",    
  •                     success: function (response) {    
  •                         $('#pickermodal').modal('hide');    
  •                         $('[id*=hfUserName]').val('');    
  •                         $('[id*=hfPostId]').val('');    
  •                         $(lblPick).attr('class', icon);    
  •                         $(lbliconam).html(iconName);    
  •     
  •                     },    
  •                     failure: function (response) {    
  •                         alert(response.d);    
  •                     },    
  •                     error: function (response) {    
  •                         alert(response.d);    
  •                     }    
  •                 });    
  •                 return false;    
  •             });    
  •             });    
  •            
  •     
  • protected void Getpost_ItemDataBound(object sender, DataListItemEventArgs e)    
  •     {    
  • //display the result
  • 1 Reply

    Know the answer? Post it — somebody with the same question will find it here.