The "C# routine that is in a different frame" exists as long as the class instance that contains it exists (if we are not talking about static members).
So basicly, you cannot do that simply because when the page is loaded the associated code-behind page class is instantiated, its code runs and then it is disposed.
Please give more details of what you exactly need, maybe we find another way of doing it.