title: Identifying the source of execution
body: <p>Imagine I have a class in C# called "Bar" that has a public function on it called Foo().    </p>
  
  <p>Inside the Foo() function, is there a way for me to to identify where Foo() has been executed from?  More precisely I want to find out if Foo() was called from an .aspx file.  Like this &lt;% Bar.Foo() %>  versus from code behind  Bar.Foo().   </p>
  
  <p>The reason I ask is that I want the function to behave differently when it is executed inside a .aspx file.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I realize I can use two different functions, I really don't want to get into the boring details of my problem because it is very difficult to explain, not to mention very long.  Just know that it is a unique problem I am wrestling with, and I know I can solve it by being able to identify the source of where it is called.</p>