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
- GetCertificateRequest.cs
- XmlValidatingReader.cs
- ParseChildrenAsPropertiesAttribute.cs
- ServiceBuildProvider.cs
- RegexNode.cs
- EntityKey.cs
- SslStream.cs
- GridSplitterAutomationPeer.cs
- UxThemeWrapper.cs
- MenuItemBindingCollection.cs
- AtomServiceDocumentSerializer.cs
- TransformerInfoCollection.cs
- CorePropertiesFilter.cs
- DictionaryGlobals.cs
- DropDownButton.cs
- FacetValueContainer.cs
- LabelExpression.cs
- WSSecurityOneDotOneSendSecurityHeader.cs
- mediaeventargs.cs
- MenuAdapter.cs
- ParallelTimeline.cs
- GridSplitterAutomationPeer.cs
- HttpModuleCollection.cs
- Point3DConverter.cs
- Image.cs
- ColumnHeader.cs
- FormattedTextSymbols.cs
- IndicShape.cs
- ProfileProvider.cs
- SimpleApplicationHost.cs
- ChannelEndpointElement.cs
- ExceptionList.cs
- XmlSchemaCompilationSettings.cs
- NamedPipeTransportManager.cs
- PersonalizationStateQuery.cs
- PartBasedPackageProperties.cs
- PackageDigitalSignature.cs
- HwndMouseInputProvider.cs
- XmlNodeReader.cs
- ThaiBuddhistCalendar.cs
- SortedList.cs
- DeobfuscatingStream.cs
- WmpBitmapDecoder.cs
- WindowsSysHeader.cs
- ClientSettingsStore.cs
- ImageFormatConverter.cs
- ZipIOBlockManager.cs
- SHA256.cs
- SqlDeflator.cs
- ListViewItem.cs
- ContainerParaClient.cs
- CodeSnippetTypeMember.cs
- ParamArrayAttribute.cs
- PreDigestedSignedInfo.cs
- EpmContentSerializer.cs
- VerificationAttribute.cs
- ConstructorNeedsTagAttribute.cs
- datacache.cs
- XmlSchemaValidationException.cs
- AvTrace.cs
- GenerateTemporaryAssemblyTask.cs
- M3DUtil.cs
- TraceHwndHost.cs
- NameTable.cs
- ManualResetEvent.cs
- MetadataArtifactLoader.cs
- NotImplementedException.cs
- DynamicRendererThreadManager.cs
- MetabaseReader.cs
- LambdaCompiler.Logical.cs
- WinEventWrap.cs
- XmlBoundElement.cs
- Scalars.cs
- DataServiceCollectionOfT.cs
- Hex.cs
- CodeNamespace.cs
- ReflectionUtil.cs
- TableLayoutPanelBehavior.cs
- IImplicitResourceProvider.cs
- BinaryParser.cs
- PropertyDescriptor.cs
- SmiXetterAccessMap.cs
- DeviceContexts.cs
- TableRow.cs
- wmiprovider.cs
- CSharpCodeProvider.cs
- SystemColorTracker.cs
- FileAuthorizationModule.cs
- Visual3D.cs
- Visual.cs
- TypeConverter.cs
- ThumbAutomationPeer.cs
- XmlSerializerSection.cs
- WorkflowApplication.cs
- RangeValueProviderWrapper.cs
- IntegerCollectionEditor.cs
- XPathItem.cs
- Matrix3DValueSerializer.cs
- Events.cs
- FlowLayoutPanelDesigner.cs