'C# ASP.NET 6.0 getting button text from shared page to index page as variable

I have 4 buttons in my layout page (shared page) and I want to use these buttons' text value upon click event. The text value needs to be used inside the index page, in order to execute C# code.

I have been looking everywhere for a solution to that. I would appreciate any ideas.

I want to create a single page web application, that changes data in index page, based on the clicked button in layout.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source