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
- SerialPinChanges.cs
- Int64Converter.cs
- xml.cs
- UnmanagedMemoryStream.cs
- NavigationExpr.cs
- _ProxyRegBlob.cs
- DateTimeOffsetStorage.cs
- Lasso.cs
- CLRBindingWorker.cs
- ConfigUtil.cs
- ColorDialog.cs
- RepeatInfo.cs
- LicenseManager.cs
- storepermissionattribute.cs
- ToolboxItemFilterAttribute.cs
- FontSourceCollection.cs
- SourceElementsCollection.cs
- XmlCharType.cs
- DBSchemaRow.cs
- DataBinder.cs
- EmptyElement.cs
- FilterException.cs
- ExtensionElementCollection.cs
- PersonalizationEntry.cs
- ConfigUtil.cs
- GenericEnumConverter.cs
- StandardToolWindows.cs
- SparseMemoryStream.cs
- PersianCalendar.cs
- _CommandStream.cs
- DataTableNewRowEvent.cs
- ListSortDescriptionCollection.cs
- FrameworkReadOnlyPropertyMetadata.cs
- XmlReaderDelegator.cs
- TransformPatternIdentifiers.cs
- DataGridViewButtonColumn.cs
- WindowsUpDown.cs
- WmlControlAdapter.cs
- PagesSection.cs
- ColumnWidthChangingEvent.cs
- ResourceAssociationType.cs
- XhtmlConformanceSection.cs
- MenuBindingsEditorForm.cs
- TableSectionStyle.cs
- InputLangChangeRequestEvent.cs
- UnionCqlBlock.cs
- StructuredProperty.cs
- AssemblyInfo.cs
- StringValidatorAttribute.cs
- SqlAliasesReferenced.cs
- TemplateLookupAction.cs
- IpcPort.cs
- InvalidPrinterException.cs
- ParameterSubsegment.cs
- ColumnWidthChangingEvent.cs
- ParseChildrenAsPropertiesAttribute.cs
- JapaneseCalendar.cs
- TimelineGroup.cs
- PolicyLevel.cs
- TextElementEditingBehaviorAttribute.cs
- ModelUtilities.cs
- TextBox.cs
- RectKeyFrameCollection.cs
- WebDescriptionAttribute.cs
- RepeatBehaviorConverter.cs
- DocumentAutomationPeer.cs
- GuidTagList.cs
- HwndStylusInputProvider.cs
- mansign.cs
- FontFamilyValueSerializer.cs
- RegexCapture.cs
- ContentFilePart.cs
- WrappedIUnknown.cs
- StrokeIntersection.cs
- CompositeActivityCodeGenerator.cs
- BinHexDecoder.cs
- RenderData.cs
- ApplicationDirectory.cs
- MatrixTransform.cs
- EventArgs.cs
- NotificationContext.cs
- EventsTab.cs
- AssociationSet.cs
- MatrixValueSerializer.cs
- Function.cs
- UInt16Storage.cs
- AssociationType.cs
- Deflater.cs
- Timer.cs
- RootProfilePropertySettingsCollection.cs
- SimpleLine.cs
- SessionEndingEventArgs.cs
- SecurityPolicySection.cs
- EntityEntry.cs
- WorkflowService.cs
- DiscoveryRequestHandler.cs
- SchemaCompiler.cs
- RegexParser.cs
- RegexGroup.cs
- QueryConverter.cs