SanSYS

Untitled

Mar 10th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. //Метод класса PageRouteHandler
  2. public virtual IHttpHandler GetHttpHandler(RequestContext requestContext) {
  3.     if (requestContext == null) {
  4.         throw new ArgumentNullException("requestContext");
  5.     }
  6.  
  7.     string virtualPath = GetSubstitutedVirtualPath(requestContext);
  8.     // Virtual Path ----s up with query strings, so we need to strip them off
  9.     int qmark = virtualPath.IndexOf('?');
  10.     if (qmark != -1) {
  11.         virtualPath = virtualPath.Substring(0, qmark);
  12.     }
  13.     if (this.CheckPhysicalUrlAccess && !CheckUrlAccess(virtualPath, requestContext)) {
  14.         return new UrlAuthFailureHandler();
  15.     }
  16.  
  17.     //Как видим, чтобы нам не вернул метод, результат преобразовывается в Page
  18.     Page page = BuildManager.CreateInstanceFromVirtualPath(virtualPath, typeof(Page)) as Page;
  19.     return page;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment