Hi suhaas121,
You have to use OnClientClick instead of OnClick and need to add return statement before the function name.
Check this example. Now please take its reference and correct your code.
HTML
<asp:LinkButton ID="lnkclose" OnClientClick="return hideDiv();" runat="server"
CssClass="btn btn-danger btn-rounded btn-icon" Width="50px" ToolTip="Close"><i class="fas fa-times"></i></asp:LinkButton>
<script>
function hideDiv() {
return false;
}
</script>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
lnkclose.Attributes.Add("onClick", "return hideDiv();");
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
lnkclose.Attributes.Add("onClick", "return hideDiv();")
End Sub