Hello,
Added your function in Page Load
When first time Page is Load then not goes to in this function. After then u do any operation in page then it call this funciton
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
//Call YOur FUnction HERE
}
}
Hope this helpful!
Thanks