I am new to .net web forms programming (also my first time posting on here) and I am trying to get the title of a page from another class called session.
From each code behind page for each of my content pages, I am calling a method that is in a Session class. I am trying to update the code so that under certain circumstances, I can get the page title of the page that called the method in the Session class. However, I don't want to have to update all the code behind files calling the class (there are a lot) to send the page instance as a parameter in the method. Is there a way I could get the Page instance of the class that called the method from inside the Session class instead? I can get the Url of the page using HttpContext.current.Request.Url.AbsoluteUri so I was hoping I could use something similar to get the page or the title, or that I can use the url to get the page or title.
When I googled this everything I am finding is for if you already have the page instance and have been unable to find a way to actually get that page instance or title.
Note: The Session class is written using C#.
Thanks