micah says:
<
asp:Repeater
ID
=
"Repeater1"
runat
=
"server"
>
<
ItemTemplate
>
<
span
class
=
"gamma-container"
style
=
"margin-bottom:6px"
>
<
asp:LinkButton
ID
=
"btncall"
runat
=
"server"
>
<
asp:Image
ID
=
"Image2user"
Text='<%#Eval("ImageName")%>' runat="server" src='<%#getSRCDD(Container.DataItem)%> ' class="mygallery img-thumbnail animated slideInLeft" style=" background-repeat:no-repeat;" alt="" data-aria-label-part="" background-image='<%# ("../UserImage/") %>' ImageAlign="Middle" />
</
asp:LinkButton
>
</
span
>
</
ItemTemplate
>
</
asp:Repeater
>
replace above with below code
<div>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<span class="gamma-container" style="margin-bottom: 6px">
<asp:LinkButton ID="btncall" runat="server">
<asp:Image ID="Image2user" Text='<%#Eval("ImageName")%>' runat="server" src='<%#getSRCDD(Container.DataItem)%>'
class="mygallery img-thumbnail animated slideInLeft" Style="background-repeat: no-repeat;"
alt="" data-aria-label-part="" background-image='<%# ("../UserImage/") %>' ImageAlign="Middle" />
</asp:LinkButton>
<asp:Label ID="lblGallaryId" Text='<%#Eval("Id") %>' runat="server" />
</span>
</ItemTemplate>
</asp:Repeater>
</div>
micah says:
<script type=
"text/javascript"
>
$(
function
() {
$(
'[id*=btncall]'
).on(
'click'
,
function
() {
var
id = $(
this
).closest(
'tr'
).find($(
'[id*=lblGallaryId]'
)).text();
$.ajax({
type:
"POST"
,
url:
"AlbumPage.aspx/GetGallery"
,
data:
'{id:"'
+ id +
'"}'
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
,
success:
function
(response) {
var
table = $(
"#modalbody"
).find(
'div'
).eq(0).clone(
true
);
var
customers = response.d;
$(
"#modalbody"
).find(
'div'
).eq(0).remove();
$(customers).each(
function
() {
$(
".userphotos"
, table).attr(
'src'
,
'UserImage/'
+
this
.photos);
$(
".username"
, table).html(
this
.UserName);
$(
"#modalbody"
).append(table);
table = $(
"#modalbody"
).find(
'div'
).eq(0).clone(
true
);
});
$(
'#myModal'
).modal(
'show'
);
},
failure:
function
(response) {
alert(response.d);
},
error:
function
(response) {
alert(response.d);
}
});
return
false
;
});
});
</script>
above code with below
<script type="text/javascript">
$(function () {
$('[id*=btncall]').on('click', function () {
var id = $(this).closest('div').find('[id*=lblGallaryId]').html();
$.ajax({
type: "POST",
url: "AlbumPage.aspx/GetGallery",
data: '{id:"' + id + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
$(".userphotos").attr('src', 'UserImage/' + response.d[0].photos);
$(".username").html(response.d[0].UserName);
$('#myModal').modal('show');
},
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
return false;
});
});
</script>
Dont simply copy paste the code first try to understand the code what is done and how it is done unecessarily you have used the code which is nothing to do with your requirement.