I have HomeController which loads data to model from SQL DB.
Before the:
public ActionResult Index()
{
return View(_homePageViewModel);
}
is hit, the data is loaded to
_homePageViewModel
and when it is ready the Razor Page is being loaded.
I have managed to show Loading GIF while Razor Page's content is being loaded, but there is some time before it that nothing is shown, it's when the HomeController's main constructor loads data from DB.
I need to show progress bar that will go from 0% to 100% while loading data from the DB.
I don't know how to achieve as the Index Page is not loaded yet.
Do I need to load loader page before the Index is rendered? Just to cover the time HomeController finishes it's work?