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
- DocumentViewerHelper.cs
- Stackframe.cs
- DocumentSequenceHighlightLayer.cs
- ConfigurationValues.cs
- FamilyTypefaceCollection.cs
- unsafenativemethodstextservices.cs
- LineMetrics.cs
- SocketPermission.cs
- ParallelLoopState.cs
- WorkflowServiceNamespace.cs
- XmlAttributeCache.cs
- iisPickupDirectory.cs
- ValuePatternIdentifiers.cs
- WinInetCache.cs
- KnownTypesProvider.cs
- InvalidOperationException.cs
- InteropBitmapSource.cs
- GeometryHitTestParameters.cs
- BitmapCache.cs
- XmlUnspecifiedAttribute.cs
- SecurityMessageProperty.cs
- ContainerAction.cs
- TextLine.cs
- TextParaClient.cs
- peersecuritysettings.cs
- PropertiesTab.cs
- MetafileHeaderWmf.cs
- loginstatus.cs
- SamlDelegatingWriter.cs
- Renderer.cs
- SqlTransaction.cs
- ColorAnimation.cs
- Label.cs
- Profiler.cs
- OrderPreservingSpoolingTask.cs
- _NestedSingleAsyncResult.cs
- AvTraceDetails.cs
- XmlNotation.cs
- DataTableNewRowEvent.cs
- NetworkInterface.cs
- RotateTransform3D.cs
- StringToken.cs
- UnsafeNativeMethodsPenimc.cs
- FormViewDeletedEventArgs.cs
- IDataContractSurrogate.cs
- Baml2006ReaderContext.cs
- GradientStop.cs
- UIElementParagraph.cs
- StylusButtonEventArgs.cs
- TransformedBitmap.cs
- HtmlInputButton.cs
- CustomWebEventKey.cs
- XPathDocumentBuilder.cs
- MetaColumn.cs
- LeafCellTreeNode.cs
- CommonRemoteMemoryBlock.cs
- NonClientArea.cs
- PropertyChangingEventArgs.cs
- TypeContext.cs
- XamlWriter.cs
- XamlTypeMapper.cs
- EventLogReader.cs
- StandardToolWindows.cs
- LineServices.cs
- DotExpr.cs
- AQNBuilder.cs
- EntityContainerAssociationSet.cs
- EntitySetBase.cs
- HttpSessionStateWrapper.cs
- DictionaryEditChange.cs
- PerformanceCountersElement.cs
- DataServicePagingProviderWrapper.cs
- Native.cs
- MSAAWinEventWrap.cs
- CharacterShapingProperties.cs
- SqlProviderServices.cs
- ProfileProvider.cs
- QuestionEventArgs.cs
- TraceSection.cs
- LocalizationParserHooks.cs
- MethodExpression.cs
- HtmlInputText.cs
- LocatorPartList.cs
- HostingEnvironment.cs
- FilterableAttribute.cs
- SQlBooleanStorage.cs
- SimpleHandlerBuildProvider.cs
- OdbcConnectionFactory.cs
- TextSelection.cs
- SessionStateModule.cs
- IDataContractSurrogate.cs
- WebUtil.cs
- QuestionEventArgs.cs
- GridViewRow.cs
- TCPClient.cs
- CollectionBuilder.cs
- QilLiteral.cs
- ISSmlParser.cs
- CatalogPartCollection.cs
- HitTestWithPointDrawingContextWalker.cs