Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / PageHandlerFactory.cs / 2 / PageHandlerFactory.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * Handler Factory implementation for Page files * * Copyright (c) 1999 Microsoft Corporation */ namespace System.Web.UI { using System.Runtime.Serialization.Formatters; using System.IO; using System.Security.Permissions; using System.Web.Compilation; using System.Web.Util; using Debug=System.Web.Util.Debug; /* * Handler Factory implementation for ASP.NET files */ [PermissionSet(SecurityAction.LinkDemand, Unrestricted = true)] [PermissionSet(SecurityAction.InheritanceDemand, Unrestricted=true)] public class PageHandlerFactory : IHttpHandlerFactory2 { private bool _isInheritedInstance; protected internal PageHandlerFactory() { // Check whether this is the exact PageHandlerFactory, or a derived class _isInheritedInstance = (GetType() != typeof(PageHandlerFactory)); } public virtual IHttpHandler GetHandler(HttpContext context, string requestType, string virtualPath, string path) { Debug.Trace("PageHandlerFactory", "PageHandlerFactory: " + virtualPath); // This should never get called in ISAPI mode but currently is in integrated mode // Debug.Assert(false); return GetHandlerHelper(context, requestType, VirtualPath.CreateNonRelative(virtualPath), path); } IHttpHandler IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) { // If it's a derived class, we must call the old (less efficient) GetHandler, in // case it was overriden if (_isInheritedInstance) { return GetHandler(context, requestType, virtualPath.VirtualPathString, physicalPath); } return GetHandlerHelper(context, requestType, virtualPath, physicalPath); } public virtual void ReleaseHandler(IHttpHandler handler) { } private IHttpHandler GetHandlerHelper(HttpContext context, string requestType, VirtualPath virtualPath, string physicalPath) { Page page = BuildManager.CreateInstanceFromVirtualPath( virtualPath, typeof(Page), context, true /*allowCrossApp*/, true /*noAssert*/) as Page; if (page == null) return null; page.TemplateControlVirtualPath = virtualPath; return page; } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- _AutoWebProxyScriptWrapper.cs
- GenericXmlSecurityTokenAuthenticator.cs
- ActivityPreviewDesigner.cs
- DataTableNewRowEvent.cs
- PropertyInformation.cs
- DateTimeOffset.cs
- _ListenerAsyncResult.cs
- RsaEndpointIdentity.cs
- FixedPageProcessor.cs
- KeyGestureConverter.cs
- DbConnectionPool.cs
- Transform3DGroup.cs
- HtmlInputButton.cs
- CounterSampleCalculator.cs
- StringReader.cs
- DataTableMappingCollection.cs
- MultiDataTrigger.cs
- SignedXml.cs
- WebPartEventArgs.cs
- AdornerDecorator.cs
- AccessViolationException.cs
- basecomparevalidator.cs
- DataReaderContainer.cs
- XamlToRtfParser.cs
- base64Transforms.cs
- WebResourceUtil.cs
- SimpleType.cs
- HitTestParameters3D.cs
- PriorityQueue.cs
- SymLanguageVendor.cs
- AuthenticationService.cs
- BatchWriter.cs
- OutputCacheSettings.cs
- WebEventCodes.cs
- RootProfilePropertySettingsCollection.cs
- DataGridViewSelectedCellCollection.cs
- DirectionalLight.cs
- ParseNumbers.cs
- BinaryFormatterSinks.cs
- Model3DGroup.cs
- EUCJPEncoding.cs
- ImageList.cs
- StateWorkerRequest.cs
- DbConnectionPoolCounters.cs
- GenericUI.cs
- InvalidDataException.cs
- NativeMethods.cs
- ProgressBarRenderer.cs
- ItemList.cs
- StorageEntityContainerMapping.cs
- MatrixStack.cs
- ExpressionPrefixAttribute.cs
- ProjectionCamera.cs
- SqlTypeSystemProvider.cs
- PathGeometry.cs
- HtmlDocument.cs
- StringConcat.cs
- InvokeHandlers.cs
- InternalSafeNativeMethods.cs
- NumberAction.cs
- DependencyPropertyKind.cs
- FunctionDescription.cs
- NativeMethods.cs
- CacheChildrenQuery.cs
- XmlILCommand.cs
- DrawTreeNodeEventArgs.cs
- PagesSection.cs
- HostVisual.cs
- SoapAttributeOverrides.cs
- WindowsListViewItemStartMenu.cs
- VectorAnimationBase.cs
- FacetValueContainer.cs
- WebHttpBindingCollectionElement.cs
- XamlPathDataSerializer.cs
- SiteMapDataSourceView.cs
- recordstatescratchpad.cs
- MetadataArtifactLoaderResource.cs
- WebSysDescriptionAttribute.cs
- FormatSelectingMessageInspector.cs
- DbDataReader.cs
- RuntimeConfig.cs
- Operand.cs
- DataSourceGeneratorException.cs
- ListContractAdapter.cs
- ConfigXmlCDataSection.cs
- InternalConfigRoot.cs
- FixedSOMContainer.cs
- Soap.cs
- WindowsFormsDesignerOptionService.cs
- UnsafeNativeMethods.cs
- SessionPageStateSection.cs
- ServerValidateEventArgs.cs
- LogArchiveSnapshot.cs
- EditCommandColumn.cs
- SecurityElementBase.cs
- TreeNodeBindingCollection.cs
- BuildManager.cs
- UrlPath.cs
- SystemBrushes.cs
- NameSpaceEvent.cs