Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / Mobile / MobileRedirect.cs / 1305376 / MobileRedirect.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Web; using System.Web.UI.MobileControls; namespace System.Web.Mobile { /* * Mobile Redirect * An internal helper class that provides methods to work around redirection issues with * mobile devices. * * Copyright (c) 2000 Microsoft Corporation */ [Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")] internal class MobileRedirect { // internal static readonly String QueryStringVariable = "__redir"; internal static readonly String QueryStringValue = "1"; /* Obsolete internal static readonly String QueryStringAssignment = QueryStringVariable + "=" + QueryStringValue; private static readonly String _redirectQueryString = "?" + QueryStringAssignment; private static readonly String _redirectQueryStringInline = QueryStringAssignment + "&"; private static readonly String _disallowRedirectionKey = "_disallowRedirection"; */ // This class should not be instantiated. private MobileRedirect() { } /* Obsolete internal static void AllowRedirection(HttpContext context) { context.Items.Remove(_disallowRedirectionKey); } internal static void DisallowRedirection(HttpContext context) { context.Items[_disallowRedirectionKey] = 1; } internal static void CheckForInvalidRedirection(HttpContext context) { HttpResponse response = context.Response; if (response != null && response.StatusCode == 302 && context.Items[_disallowRedirectionKey] != null) { response.ClearHeaders(); throw new Exception(SR.GetString(SR.MobileRedirect_RedirectNotAllowed)); } } */ /* functionality merged into Response.Redirect internal static void RedirectToUrl(HttpContext context, String url, bool endResponse) { //do not add __redir=1 if it already exists int i = url.IndexOf(QueryStringAssignment); if(i == -1) { i = url.IndexOf('?'); if (i >= 0) { url = url.Insert(i + 1, _redirectQueryStringInline); } else { url = String.Concat(url, _redirectQueryString); } } AllowRedirection(context); MobilePage page = context.Handler as MobilePage; // cookieless authentication already handles this. if ( (page != null) && (!page.Device.SupportsRedirectWithCookie) ) { String formsAuthCookieName = Security.FormsAuthentication.FormsCookieName; if(formsAuthCookieName != String.Empty) { context.Response.Cookies.Remove(formsAuthCookieName); } } context.Response.Redirect(url, endResponse); } */ } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DialogResultConverter.cs
- ParameterCollection.cs
- Opcode.cs
- ProjectionCamera.cs
- DesignerDataRelationship.cs
- CompiledXpathExpr.cs
- DataRowExtensions.cs
- DesignTimeVisibleAttribute.cs
- WebSysDescriptionAttribute.cs
- EntityContainerAssociationSet.cs
- ExpressionEditorAttribute.cs
- TypeListConverter.cs
- Point4DConverter.cs
- ResourceReferenceExpression.cs
- SafeHandles.cs
- AddInToken.cs
- Crc32.cs
- RangeValuePattern.cs
- NamespaceList.cs
- DataGridViewAccessibleObject.cs
- SymLanguageVendor.cs
- UnsafeMethods.cs
- CodeTypeDelegate.cs
- MarkupObject.cs
- AdPostCacheSubstitution.cs
- SafeNativeMethods.cs
- EncryptedPackage.cs
- ControlPersister.cs
- DynamicValueConverter.cs
- SelectionUIService.cs
- GridViewRowPresenterBase.cs
- BaseWebProxyFinder.cs
- RangeBaseAutomationPeer.cs
- StylusPoint.cs
- StructuredTypeEmitter.cs
- NetworkInterface.cs
- Pkcs9Attribute.cs
- WebBrowser.cs
- Point3DCollection.cs
- WebHttpElement.cs
- WebServicesInteroperability.cs
- DescendantQuery.cs
- DecoratedNameAttribute.cs
- TextRangeProviderWrapper.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- CharacterBuffer.cs
- MethodImplAttribute.cs
- DefaultAsyncDataDispatcher.cs
- NegatedCellConstant.cs
- odbcmetadatafactory.cs
- OdbcConnectionStringbuilder.cs
- DataGridSortCommandEventArgs.cs
- Span.cs
- Camera.cs
- ServiceModelInstallComponent.cs
- EditingCommands.cs
- ResolveResponse.cs
- AutoGeneratedField.cs
- ContentHostHelper.cs
- ContractMapping.cs
- TableHeaderCell.cs
- Win32Native.cs
- CompensateDesigner.cs
- RoutedEventConverter.cs
- XmlNodeList.cs
- HtmlInputHidden.cs
- DBCommand.cs
- XamlParser.cs
- EmbeddedObject.cs
- BaseCodeDomTreeGenerator.cs
- XpsFixedPageReaderWriter.cs
- HtmlInputText.cs
- BaseResourcesBuildProvider.cs
- XmlChildNodes.cs
- wgx_render.cs
- MenuItem.cs
- ConfigurationLockCollection.cs
- FaultDesigner.cs
- StickyNoteHelper.cs
- GridViewUpdateEventArgs.cs
- StylusTip.cs
- DesignerEventService.cs
- PathSegmentCollection.cs
- SoapReflectionImporter.cs
- PackageRelationshipSelector.cs
- XamlBrushSerializer.cs
- EntityDataSourceDesignerHelper.cs
- RelatedEnd.cs
- QilGenerator.cs
- DetailsViewRowCollection.cs
- ConfigurationConverterBase.cs
- ReadOnlyAttribute.cs
- Matrix.cs
- TaskFileService.cs
- SplashScreenNativeMethods.cs
- FormClosingEvent.cs
- CompositionTarget.cs
- QilStrConcatenator.cs
- LogicalCallContext.cs
- DataSvcMapFile.cs