On the main form, I have a menu on the left side, and a “Panel” on the right side. For certain things, I have a usercontrol form.
When clicking “computers”, I have it run the below code.
var ComputersUserPanel = new ComputersPanel(site);
ContentPanel.Controls.Clear();
ContentPanel.Controls.Add(ComputersUserPanel);
When this loads, the ComputerPanel will run a SQL function to get all the computers for a site. Now this can be a lot which is the issue. Every time I click a different menu item then click computers menu item again, it runs the above again, which can be a lot. I want it to run once then cache that information somehow.
The secondary issue is, loading and caching 1 site would be fine, but this could be multiple, meaning the same computer user control form is using for multiple sites and the have to be sperate.