I’m trying to get a handle to a webpage that the user has NOT opened yet (searching through the pages in their session won’t help).
Is there a way to do this with introspection or a method I haven’t been able to find?
In a nutshell, I’m looking for something along the lines of this:
MyApp.GetWebPageByName(SomePageName).show
Here’s a more detailed explanation of my usage scenario in my web application:
The app has dozens of WebPages (pageX, pageY, pageZ, etc.).
Depending on which user has logged in, they are presented with a menu corresponding to a subset of the pages (for example, just pageX and pageZ).
Based on their selection, the appropriate WebPage is opened.
In the past, I have done this using either If/Then/else or Select Case statements covering every possible WebPage (with their names hard-coded and each case going to a separate hard-coded line for that specific WebPage (PageX.show)
I’d really like to get rid of the If/Then/Else and Select with their dozens of lines of hard-coded page names and replace them with a single line something like this:
MyApp.GetWebPageByName(SomePageName).show
or even 2 lines:
dim NextPage as WebPage=SomeMethodThatGetsMeThePageByName(SomePageName)
NextPage.show
Help appreciated!