Say I have 2 pages called Page1 and Page2. When I post to page 2 from Page 1, and vice-versa, I want to test Page.Previous page and compare against the class type of Page1 or 2 to ensure that the originator is correct.
How do I do this? Previously I couldn't get access to my page classes so I wrapped the class in a namespace called MyPages. However, because the class is partial I'm not sure if having a partial class in a namespace would work? When I tried this code:
If not page.ispostback then
if page.previouspage is nothing then
if page.previouspage IS MyPages.Page2 then.... <-- this also doesn't work because Page2 doesn't pop-up in intellisense.
end if
end if
Anyway, basically all I need to do in the page_load() event of Page1, is check that previous page is posted back from the expected page using the type. If this ca ...
Go to the complete details ...