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
- Focus.cs
- BooleanStorage.cs
- EmbeddedMailObjectCollectionEditor.cs
- TextEditorTables.cs
- EdmSchemaError.cs
- SqlDataSource.cs
- HotCommands.cs
- SupportsEventValidationAttribute.cs
- ISAPIWorkerRequest.cs
- HtmlInputControl.cs
- WebUtility.cs
- CellRelation.cs
- CharacterString.cs
- NoPersistHandle.cs
- Clipboard.cs
- EpmCustomContentSerializer.cs
- EmptyEnumerator.cs
- SerialPinChanges.cs
- Vertex.cs
- BitmapDecoder.cs
- PreloadedPackages.cs
- ObjectViewEntityCollectionData.cs
- ManagementExtension.cs
- TypedReference.cs
- SourceSwitch.cs
- SqlExpressionNullability.cs
- ValueSerializerAttribute.cs
- SmtpCommands.cs
- InputReportEventArgs.cs
- ResourcePool.cs
- IdentifierCreationService.cs
- Sequence.cs
- DriveInfo.cs
- StrokeNode.cs
- ProcessRequestArgs.cs
- Int16Storage.cs
- MD5CryptoServiceProvider.cs
- _RegBlobWebProxyDataBuilder.cs
- XmlAttributeProperties.cs
- BuildManager.cs
- FullTextBreakpoint.cs
- DependencyProperty.cs
- BaseTemplateParser.cs
- XmlKeywords.cs
- UIntPtr.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- DataTrigger.cs
- WebEncodingValidator.cs
- DbConnectionFactory.cs
- MailHeaderInfo.cs
- ThumbButtonInfoCollection.cs
- basecomparevalidator.cs
- Margins.cs
- ClientData.cs
- ElementNotEnabledException.cs
- BaseConfigurationRecord.cs
- Interlocked.cs
- SqlException.cs
- DataTemplate.cs
- TypeBuilder.cs
- ResponseStream.cs
- XmlSigningNodeWriter.cs
- InputScope.cs
- Int16.cs
- Slider.cs
- ThreadPoolTaskScheduler.cs
- SoapWriter.cs
- HttpRuntime.cs
- SiteIdentityPermission.cs
- SoapSchemaMember.cs
- CompressEmulationStream.cs
- GPPOINT.cs
- SuppressMessageAttribute.cs
- XmlCodeExporter.cs
- SqlProviderManifest.cs
- SafeTimerHandle.cs
- ZipIOLocalFileDataDescriptor.cs
- WebReferenceOptions.cs
- SapiGrammar.cs
- ILGenerator.cs
- ConfigViewGenerator.cs
- Freezable.cs
- MarshalByRefObject.cs
- WindowsMenu.cs
- SettingsContext.cs
- ActiveDesignSurfaceEvent.cs
- BasicExpandProvider.cs
- LinkedResourceCollection.cs
- Vector3DValueSerializer.cs
- TaiwanLunisolarCalendar.cs
- WebBrowserPermission.cs
- DocumentReference.cs
- WebPartConnectionsConnectVerb.cs
- ListSortDescription.cs
- SerialPort.cs
- PeerPresenceInfo.cs
- QuaternionConverter.cs
- ErrorInfoXmlDocument.cs
- SmtpAuthenticationManager.cs
- CellQuery.cs