Cross Page Posting in ASP.NET

I answered a question on the forums today with someone asking about the PreviousPage property that we have access to now. Basically, the question was
Okay now I have the previous page but I want to cast it to that partial class type and it says it can’t find it. So if we have a page name Simba we would like to do the following:

Dim simbaPage as Simba = CType(me.PreviousPage,Simba)

The answer is pretty simple. You just need to place a @Reference into the HTML code on the page you are trying to do the cast on …

<%@ Reference Page="~/Simba.aspx" %>

Now the Simba class is available to you.