Is there a method that returns a System.Web.UI.Page class given an URL?
<p>I'd like to be able to determine what class will be called given an URL. </p>

<p>For instance, </p>

<p>I have a page /First.aspx that has a hyperlink to /Second.aspx</p>

<p>In the code behind for First.aspx.cs, I'd like to be able to determine what class will execute if someone clicks on the hyperlink that points to /Second.aspx.</p>

<p>EDIT:
One of the reponders asked me to outline the problem I'm trying to address. Here it is:</p>

<p>The codebase I inherited has a subclass the System.Web.UI.Page that has a public Authorized method that returns a boolean. The Authorized method checks the parameters passed via the query string against the authenticated user, and determines whether that user should be allowed to call that page with the given parameters.</p>

<p>Elsewhere in the site I have hyperlinks that reference those protected pages. In some instances those links are displayed to users who are not authorized to navigate to that page. They can click the link, however they get an error. In other instances, prior developers when through the trouble of inserting logic that hides the hyperlink for those unauthorized users, but the authorization logic is duplicated (In the page itself, and in the linking page).</p>

<p>What I would like to do is create a subclass of the hyperlink class, and have the subclass inspect the NavigateUrl, determine the destination page class,  and call the Authorized method of that class to determine if the user is authorized to call that page. If the user is not authorize, the link will automatically hide itself.</p>
