Hi nauna,
Check below code. Set the UpdateProgress visible true on LinkButton click and on UpdatePanel refresh set visible false.
<asp:ScriptManager runat="server" />
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<div class="modal">
<div class="center">
<img alt="" src="loader.gif" />
</div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel1">
<ContentTemplate>
<div class="chat_container">
<asp:Timer ID="timer" runat="server" Interval="2000" OnTick="Timer1_Tick">
</asp:Timer>
<asp:ListView ID="ListView1" runat="server">
<ItemTemplate>
<div class="all-msgs d-inbox">
<asp:LinkButton ID="LinkButton1" runat="server">View</asp:LinkButton>
<asp:Label ID="Label3" runat="server" Text='<%#Eval("Id") %>' CssClass="badge pull-right theme-bg"></asp:Label>
</div>
</ItemTemplate>
</asp:ListView>
<asp:Label ID="lblID" runat="server" />
<asp:HiddenField ID="hfQuerStringID" runat="server" />
<asp:HiddenField ID="hfSelectedLabel" runat="server" />
<input type="hidden" id="div_position" name="div_position" />
<input type="hidden" id="hfIsClicked" />
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="timer" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<style type="text/css">
.chat_container {
overflow-y: auto;
display: block;
max-height: 650px;
height: 100%;
min-height: 600px;
font-family: 'Roboto', sans-serif;
}
.selected {
background-color: #f44336;
color: white;
text-align: center;
text-decoration: none;
}
body {
margin: 0;
padding: 0;
font-family: Arial;
}
.modal {
position: fixed;
z-index: 999;
height: 100%;
width: 100%;
top: 0;
background-color: Black;
filter: alpha(opacity=60);
opacity: 0.6;
-moz-opacity: 0.8;
}
.center {
z-index: 1000;
margin: 300px auto;
padding: 10px;
width: 130px;
background-color: White;
border-radius: 10px;
filter: alpha(opacity=100);
opacity: 1;
-moz-opacity: 1;
}
.center img {
height: 128px;
width: 128px;
}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$('body').on('click', '[id*=LinkButton1]', function () {
$('[id*=Label3]').removeClass();
$('[id*=Label3]').addClass('badge pull-right theme-bg');
var id = $(this).closest('div').find('[id*=Label3]').html();
var oldURL = window.location.protocol + "//" + window.location.host + window.location.pathname;
if (history.pushState) {
var newUrl = oldURL + "?ID=" + id;
window.history.pushState({ path: newUrl }, '', newUrl);
$('#hfQuerStringID').val(id);
}
scroll();
$('#hfSelectedLabel').val($(this).closest('div').find('[id*=Label3]').attr('id'));
$(this).closest('div').find('[id*=Label3]').addClass('selected');
var updateProgress = $find("<%= UpdateProgress1.ClientID %>");
window.setTimeout(function () {
updateProgress.set_visible(true);
}, 100);
return false;
});
$(function () {
scroll();
});
function scroll() {
var div = $('.chat_container');
var div_position = document.getElementById("div_position");
var position = parseInt('<%=Request.Form["div_position"] %>');
if (isNaN(position)) {
position = 0;
}
div.scrollTop = position;
div.onscroll = function () {
div_position.value = div.scrollTop;
};
}
//On UpdatePanel Refresh.
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
var updateProgress = $find("<%= UpdateProgress1.ClientID %>");
updateProgress.set_visible(false);
scroll();
var id = $('#hfSelectedLabel').val();
$('#' + id).removeClass();
$('#' + id).addClass('selected');
}
});
};
</script>