Hi arujdevia,
Use setTimeout function.
Please refer below sample.
Javascript
function updateloginname(name) {
setTimeout(function () {
$("#LblProfileName").html(name);
}, 500);
}
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<label id="LblProfileName" class="form-check-label text-white">Welcome</label>
</body>
</html>
Default
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="JavaScript.js"></script>
<script>
$(function () {
$("#footer").load("footer.html");
});
</script>
<div id="footer"></div>
<asp:Button ID="brnSave" Text="Save" runat="server" OnClick="updateloginname" />
Code
C#
protected void updateloginname(object sender, EventArgs e)
{
string message = "test";
ClientScript.RegisterStartupScript(this.GetType(), "update", "updateloginname('" + message + "');", true);
}
VB.Net
Protected Sub updateloginname(ByVal sender As Object, ByVal e As EventArgs)
Dim message As String = "test"
Dim script As String = "window.onload = function() { };"
ClientScript.RegisterStartupScript(Me.GetType(), "update", "updateloginname('" & message & "');", True)
End Sub
Screenshot