How to call a function in page load asp.net?

Sep 17 2021 5:17 PM

The function below is found in a class called page.cs

public static List<string> MyFunction()
        {
         var retList = new List<string>();
        
        retList.Add("xzy");
        retList.Add("abc");
        
return retList;
        }

On page load how to call the function and check if the list contains xzy and abc?

 protected void Page_Load(object sender, EventArgs e)
{
    //call MyFunction()
}

Answers (2)