Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Метод класса PageRouteHandler
- public virtual IHttpHandler GetHttpHandler(RequestContext requestContext) {
- if (requestContext == null) {
- throw new ArgumentNullException("requestContext");
- }
- string virtualPath = GetSubstitutedVirtualPath(requestContext);
- // Virtual Path ----s up with query strings, so we need to strip them off
- int qmark = virtualPath.IndexOf('?');
- if (qmark != -1) {
- virtualPath = virtualPath.Substring(0, qmark);
- }
- if (this.CheckPhysicalUrlAccess && !CheckUrlAccess(virtualPath, requestContext)) {
- return new UrlAuthFailureHandler();
- }
- //Как видим, чтобы нам не вернул метод, результат преобразовывается в Page
- Page page = BuildManager.CreateInstanceFromVirtualPath(virtualPath, typeof(Page)) as Page;
- return page;
- }
Advertisement
Add Comment
Please, Sign In to add comment