this previous example on this forum shows how a user can pick any image of his choice from the modal popupthen the image picked shows on the datalist, but i want the name of the image pcked to show as well besides the imageon datalist
https://www.aspforums.net/Threads/178177/How-do-i-click-CssClass-font-icon-on-modal-and-show-the-clicked-CssClass-icon-on-datalist-page/
<asp:DataList ID="Getpost" runat="server" DataKeyName="Id" Font-Bold="True" Width="100%">
<ItemTemplate>
<div class="well col-lg-6">
<asp:Label ID="Label1" Text='<%# Eval("UserName") %>' runat="server" />
<div class="" style="margin-top: 0; margin-left: 9px; margin-bottom: 8px">
<asp:Label ID="lblpost" runat="server" Text='<%# Eval("ContentPost").ToString().Length >180 ? Eval("ContentPost").ToString().Substring(0,180)+"...(Read More)" : Eval("ContentPost").ToString()%>'
Font-Bold="False" Font-Strikeout="False" ForeColor="#333333" CssClass="" Font-Names="Arial"
Font-Size="" />
</div>
<asp:Label ID="lbCOMlId" Text='<%#Eval("ID") %>' CssClass="" runat="server" Font-Size="0px"
Visible="False" />
<asp:Label ID="lbCOMlId2" Text='<%#Eval("ID") %>' CssClass="" runat="server" />
<div class="clearfix">
</div>
<asp:LinkButton ID="btnPick" Text="" runat="server">
<asp:Label ID="lblpickdefaultshow" runat="server" Text="" CssClass=" fa fa-shopping-cart"></asp:Label>
<asp:Label ID="Label6" runat="server" Text="Pick"></asp:Label>
</asp:LinkButton>
</div>
</ItemTemplate>
</asp:DataList>
<asp:HiddenField ID="hfUserName" runat="server" />
<asp:HiddenField ID="hfPostId" runat="server" />
<br />
---------------------
<script type='text/javascript'>
$(function () {
var lblPick;
$('[id*=btnPick]').on('click', function () {
lblPick = $(this).closest('tr').find('[id*=lblpickdefaultshow]');
var username = $(this).closest('tr').find('[id*=Label1]').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 userName = $('[id*=hfUserName]').val();
var postId = $('[id*=hfPostId]').val();
if ($(this).find('[id*=Label59]').length > 0) {
icon = 'fa fa-book';
}
else if ($(this).find('[id*=Label7]').length > 0) {
icon = 'fa fa-coffee';
}
else if ($(this).find('[id*=Label8]').length > 0) {
icon = 'fa fa-pencil';
}
$.ajax({
type: "POST",
url: "CS.aspx/INSERTUSERSTATUS",
data: '{icon:"' + icon + '",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)
},
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
return false;
});
});
</script>
this pick text is not changing
<asp:Label ID="Label6" runat="server" Text="Pick"></asp:Label>