Set the Parent and Child comment div with unique name.
Create different function for Show and Close reply for each parent and child anchorlink click.
Call the respective function on anchor link click.
Refer below code.
HTML
<asp:DataList ID="dl1" runat="server">
<ItemTemplate>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div style="width: 100%;">
<table style="margin: 3px 5px; width: 100%;">
<tr>
<td style="width: 55px; vertical-align: text-top;">
<asp:Image ID="Image1" runat="server" CssClass="img-responsive" Width="50" Height="50"
ImageUrl='<%# Eval("imagedata") %>' />
<asp:Label ID="Label1" runat="server" Text='<%#Bind("First_name") %>' Style="margin: -5px 0px 0px 0px; font-weight: bold; font-size: 10px; color: #f00;"></asp:Label>
<br />
</td>
<td style="padding: 0px 5px; text-align: left; vertical-align: top;">
<asp:Image ID="Image111" runat="server" ImageUrl='<%#Eval("im_name") %>' Width="150px"
Height="120px" />
<br />
<asp:Label ID="lblParentCommentID" Visible="false" runat="server" Text='<%# Eval("commentID") %>'></asp:Label>
<asp:Label ID="Label6" runat="server" Visible="false" Text='<%#Eval("CommentID") %>'></asp:Label><br />
<asp:Label ID="lblParentMessage" runat="server" Text='<%# Eval("Commentmessage") %>'></asp:Label>
<br />
<asp:Label ID="lbltime1" runat="server" Text='<%# GetTimeAgo(Eval("comment_date")) %>'></asp:Label>
<div>
<a id='lnkReplyParent<%# Eval("commentID") %>' href="javascript:void(0)" onclick="showParentReply(<%# Eval("commentID") %>); return false;">Reply</a>
<a id="lnkCancel" href="javascript:void(0)" onclick="closeParentReply(<%# Eval("commentID") %>); return false;">Cancel</a>
</div>
<div id='divParentReply<%# Eval("commentID") %>' style="display: none">
<asp:TextBox ID="txtCommentReplyParent" runat="server" CssClass="form-control" TextMode="MultiLine">
</asp:TextBox>
<asp:Button ID="btnReplyParent" runat="server" Text="Reply" CssClass="btn btn-primary input-sm"
Style="float: right; margin: 5px;" CommandName="CommentParent" />
</div>
</td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="padding-left: 75px;">
<asp:DataList ID="dlchildcomment" runat="server">
<ItemTemplate>
<div style="width: 100%;">
<table style="margin: 3px 5px; width: 100%;">
<tr>
<td style="padding: 0px 5px; text-align: left; vertical-align: top;">
<asp:Label ID="lblParentCommentID_Child" Visible="false" runat="server" Text='<%# Eval("Id") %>'>
</asp:Label>
<asp:Label ID="Lfname" runat="server" Font-Names="verdana" Font-Size="8pt" Text='<%#Bind("Name") %>'> </asp:Label>
<br />
<div>
<a id='lnkReplyChild<%# Eval("Id") %>' href="javascript:void(0)" onclick="showChildReply(<%# Eval("Id") %>); return false;">Reply</a>
<a id="lnkCancel" href="javascript:void(0)" onclick="closeChildReply(<%# Eval("Id") %>); return false;">Cancel</a>
</div>
<div id='divChildReply<%# Eval("Id") %>' style="display: none">
<asp:TextBox ID="txtCommentChild" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>
<asp:Button ID="btnReplyChild" runat="server" Text="Reply" CssClass="btn btn-primary input-sm"
Style="float: right; margin: 5px;" />
</div>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</div>
</div>
</ItemTemplate>
</asp:DataList>
JavaScript
<script type="text/ecmascript">
$(function () {
$("[id*=divParentReply]").hide();
$("[id*=divChildReply]").hide();
});
function showParentReply(n) {
$("[id*=divParentReply]").hide();
$("[id*=divParentReply" + n + "]").show();
return false;
}
function closeParentReply(n) {
$("[id*=divParentReply" + n + "]").hide();
return false;
}
function showChildReply(n) {
$("[id*=divChildReply]").hide();
$("[id*=divChildReply" + n + "]").show();
return false;
}
function closeChildReply(n) {
$("[id*=divChildReply" + n + "]").hide();
return false;
}
</script>