System.Web.WebPages A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Value cannot be null or an empty string.. Looks up a localized string similar to Value must be between {0} and {1}.. Looks up a localized string similar to Value must be a value from the "{0}" enumeration.. Looks up a localized string similar to Value must be greater than {0}.. Looks up a localized string similar to Value must be greater than or equal to {0}.. Looks up a localized string similar to Value must be less than {0}.. Looks up a localized string similar to Value must be less than or equal to {0}.. Looks up a localized string similar to Value cannot be an empty string. It must either be null or a non-empty string.. Helper extension methods for fast use of collections. Return a new array with the value added to the end. Slow and best suited to long lived arrays with few writes relative to reads. Return the enumerable as an Array, copying if required. Optimized for common case where it is an Array. Avoid mutating the return value. Return the enumerable as a Collection of T, copying if required. Optimized for the common case where it is a Collection of T and avoiding a copy if it implements IList of T. Avoid mutating the return value. Return the enumerable as a IList of T, copying if required. Avoid mutating the return value. Return the enumerable as a List of T, copying if required. Optimized for common case where it is an List of T or a ListWrapperCollection of T. Avoid mutating the return value. Remove values from the list starting at the index start. Return the only value from list, the type's default value if empty, or call the errorAction for 2 or more. Returns a single value in list matching type TMatch if there is only one, null if there are none of type TMatch or calls the errorAction with errorArg1 if there is more than one. Convert an ICollection to an array, removing null values. Fast path for case where there are no null values. Convert the array to a Dictionary using the keySelector to extract keys from values and the specified comparer. Optimized for array input. Convert the list to a Dictionary using the keySelector to extract keys from values and the specified comparer. Optimized for IList of T input with fast path for array. Convert the enumerable to a Dictionary using the keySelector to extract keys from values and the specified comparer. Fast paths for array and IList of T. Convert the list to a Dictionary using the keySelector to extract keys from values and the specified comparer. Optimized for IList of T input. No checking for other types. Helper to provide empty instances with minimal allocation. Returns a zero length array of type. Only allocates once per distinct type. A class that inherits from Collection of T but also exposes its underlying data as List of T for performance. Helpers for working with IO paths. Returns whether the path has the specified file extension. Expands a virtual path by replacing a leading "@" with the application part root or combining it with the specified baseVirtualPath Normalizes path relative to the current virtual path and throws if a file does not exist at the location. The current BrowserOverrideStore is used to get and set the user agent of a request. For an example see CookieBasedBrowserOverrideStore. The current BrowserOverrideStore BrowserOverrides can be used by BrowserHelpers to override the browser for a particular request. Wraps the caching and instantiation of paths of the BuildManager. In case of precompiled non-updateable sites, the only way to verify if a file exists is to call BuildManager.GetObjectFactory. However this method is less performant than VirtualPathProvider.FileExists which is used for all other scenarios. In this class, we optimize for the first scenario by storing the results of GetObjectFactory for a long duration. Determines if a page exists in the website. This method switches between a long duration cache or a short duration FileExistenceCache depending on whether the site is precompiled. This is an optimization because BuildManager.GetObjectFactory is comparably slower than performing VirtualPathFactory.Exists An app's is precompiled for our purposes if (a) it has a PreCompiledApp.config file in the site root, (b) The PreCompiledApp.config says that the app is not Updatable. This code is based on System.Web.DynamicData.Misc.IsNonUpdatablePrecompiledAppNoCache (DynamicData) Determines if a site exists in the VirtualPathProvider. Results of hits are cached for a very short amount of time in the FileExistenceCache. Determines if an ObjectFactory exists for the virtualPath. The BuildManager complains if we pass in extensions that aren't registered for compilation. So we ensure that the virtual path is not extensionless and that it is one of the extension Determines if the extension is one of the extensions registered with WebPageHttpHandler. Creates a reasonably unique key for a given virtual path by concatenating it with a Guid. The default BrowserOverrideStore. Gets overridden user agent for a request from a cookie. Creates a cookie to set the overridden user agent. Creates the BrowserOverrideStore setting any browser override cookie to expire in 7 days. Constructor to control the expiration of the browser override cookie. Looks for a user agent by searching for the browser override cookie. If no cookie is found returns null. Adds a browser override cookie with the set user agent to the response of the current request. If the user agent is null the browser override cookie is set to expire, otherwise its expiration is set to daysToExpire, specified when CookieBasedOverrideStore is created. DisplayInfo wraps the resolved file path and IDisplayMode for a request and path. The returned IDisplayMode can be used to resolve other page elements for the request. The Display Mode used to resolve a virtual path. Resolved path of a file that exists. Returns any IDisplayMode that can handle the given request. Returns DisplayInfo from the first IDisplayMode in Modes that can handle the given request and locate the virtual path. If currentDisplayMode is not null and RequireConsistentDisplayMode is set to true the search for DisplayInfo will only start with the currentDisplayMode. Restricts the search for Display Info to Display Modes either equal to or following the current Display Mode in Modes. For example, a page being rendered in the Default Display Mode will not display Mobile partial views in order to achieve a consistent look and feel. All Display Modes that are available to handle a request. Extension methods used to determine what browser a visitor wants to be seen as using. Stock IE6 user agent string Stock Windows Mobile 6.0 user agent string Clears the set browser for the request. After clearing the browser the overridden browser will be the browser for the request. Gets the overridden browser for the request based on the overridden user agent. If no overridden user agent is set, returns the browser for the request. Internal GetOverriddenBrowser overload to allow the browser creation function to changed. Defaults to CreateOverridenBrowser if createBrowser is null. Gets the overridden user agent for the request. If no overridden user agent is set, returns the user agent for the request. Gets a string that varies based upon the type of the browser. Can be used to override System.Web.HttpApplication.GetVaryByCustomString to differentiate cache keys based on the overridden browser. Gets a string that varies based upon the type of the browser. Can be used to override System.Web.HttpApplication.GetVaryByCustomString to differentiate cache keys based on the overridden browser. Sets the overridden user agent for the request using a BrowserOverride. Sets the overridden user agent for the request using a string Provides programmatic configuration for the anti-forgery token system. Specifies an object that can provide additional data to put into all generated tokens and that can validate additional data in incoming tokens. Specifies the name of the cookie that is used by the anti-forgery system. If an explicit name is not provided, the system will automatically generate a name. Specifies whether SSL is required for the anti-forgery system to operate. If this setting is 'true' and a non-SSL request comes into the system, all anti-forgery APIs will fail. Specifies whether to suppress the generation of X-Frame-Options header which is used to prevent ClickJacking. By default, the X-Frame-Options header is generated with the value SAMEORIGIN. If this setting is 'true', the X-Frame-Options header will not be generated for the response. Specifies whether the anti-forgery system should skip checking for conditions that might indicate misuse of the system. Please use caution when setting this switch, as improper use could open security holes in the application. Setting this switch will disable several checks, including: - Identity.IsAuthenticated = true without Identity.Name being set - special-casing claims-based identities If claims-based authorization is in use, specifies the claim type from the identity that is used to uniquely identify the user. If this property is set, all claims-based identities must return unique values for this claim type. If claims-based authorization is in use and this property has not been set, the anti-forgery system will automatically look for claim types "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" and "http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider". Allows providing or validating additional custom data for anti-forgery tokens. For example, the developer could use this to supply a nonce when the token is generated, then he could validate the nonce when the token is validated. The anti-forgery system already embeds the client's username within the generated tokens. This interface provides and consumes supplemental data. If an incoming anti-forgery token contains supplemental data but no additional data provider is configured, the supplemental data will not be validated. Provides additional data to be stored for the anti-forgery tokens generated during this request. Information about the current request. Supplemental data to embed within the anti-forgery token. Validates additional data that was embedded inside an incoming anti-forgery token. Information about the current request. Supplemental data that was embedded within the token. True if the data is valid; false if the data is invalid. An interface that provides DisplayInfo for a virtual path and request. An IDisplayMode may modify the virtual path before checking if it exists. CanHandleContext is called to determine if the Display Mode is available to return display info for the request. GetDisplayInfo should return null if the virtual path does not exist. For an example implementation, see DefaultDisplayMode. DisplayModeId is used to cache the non-null result of a call to GetDisplayInfo and should be unique for each Display Mode. See DisplayModes for the built-in Display Modes and their ids. The can take any suffix and determine if there is a corresponding file that exists given a path and request by transforming the path to contain the suffix. Add a new DefaultDisplayMode to the Modes collection to handle a new suffix or inherit from DefaultDisplayMode to provide custom logic to transform paths with a suffix. Returns DisplayInfo with the transformed path if it exists. Transforms paths according to the following rules: \some\path.blah\file.txt.zip -> \some\path.blah\file.txt.suffix.zip \some\path.blah\file -> \some\path.blah\file.suffix When set, the will only be available to return Display Info for a request if the ContextCondition evaluates to true. This class caches the result of VirtualPathProvider.FileExists for a short period of time, and recomputes it if necessary. The default VPP MapPathBasedVirtualPathProvider caches the result of the FileExists call with the appropriate dependencies, so it is less expensive on subsequent calls, but it still needs to do MapPath which can take quite some time. Provides access to the anti-forgery system, which provides protection against Cross-site Request Forgery (XSRF, also called CSRF) attacks. Generates an anti-forgery token for this request. This token can be validated by calling the Validate() method. An HTML string corresponding to an <input type="hidden"> element. This element should be put inside a <form>. This method has a side effect: it may set a response cookie. Generates an anti-forgery token pair (cookie and form token) for this request. This method is similar to GetHtml(), but this method gives the caller control over how to persist the returned values. To validate these tokens, call the appropriate overload of Validate. The anti-forgery token - if any - that already existed for this request. May be null. The anti-forgery system will try to reuse this cookie value when generating a matching form token. Will contain a new cookie value if the old cookie token was null or invalid. If this value is non-null when the method completes, the caller must persist this value in the form of a response cookie, and the existing cookie value should be discarded. If this value is null when the method completes, the existing cookie value was valid and needn't be modified. The value that should be stored in the <form>. The caller should take care not to accidentally swap the cookie and form tokens. Unlike the GetHtml() method, this method has no side effect. The caller is responsible for setting the response cookie and injecting the returned form token as appropriate. Validates an anti-forgery token that was supplied for this request. The anti-forgery token may be generated by calling GetHtml(). Throws an HttpAntiForgeryException if validation fails. Validates an anti-forgery token pair that was generated by the GetTokens method. The token that was supplied in the request cookie. The token that was supplied in the request form body. Throws an HttpAntiForgeryException if validation fails. RequestBrowserOverrideStore simply returns the user agent of the current request. Initializes a fast property helper. This constructor does not cache the helper. Creates a single fast property setter. The result is not cached. propertyInfo to extract the getter for. a fast setter. This method is more memory efficient than a dynamically compiled lambda, and about the same speed. Creates and caches fast property helpers that expose getters for every public get property on the underlying type. the instance to extract property accessors for. a cached array of all public property getters from the underlying type of this instance. Creates a single fast property getter. The result is not cached. propertyInfo to extract the getter for. a fast getter. This method is more memory efficient than a dynamically compiled lambda, and about the same speed. Given an object of anonymous type, add each property as a key and associated with its value to a dictionary. This helper will cache accessors and types, and is intended when the anonymous object is accessed multiple times throughout the lifetime of the web application. Given an object of anonymous type, add each property as a key and associated with its value to a dictionary. This helper will not cache accessors and types, and is intended when the anonymous object is accessed once or very few times throughout the lifetime of the web application. Given an object of anonymous type, add each property as a key and associated with its value to the given dictionary. This code is copied from http://www.liensberger.it/web/blog/?p=191 Determines if a type is displayable as part of a Url path. If a type is a displayable type, then we format values of that type as part of the Url Path. If not, then we attempt to create a RouteValueDictionary, and encode the value as key-value pairs in the query string. We determine if a type is displayable by whether or not it implements any interfaces. The built-in simple types like Int32 implement IFormattable, which will be used to convert it to a string. Primarily we do this check to allow anonymous types to represent key-value pairs (anonymous types don't implement any interfaces). Meant for unit tests that causes RequestFieldValidatorBase to basically ignore the unvalidated field requirement. An interface that provides information about the current executing file. WebPageRenderingBase implements this type so that all pages excluding AppStart pages could be queried to identify the current executing file. Wrapper class to be used by _pagestart.cshtml files to call into the actual page. Most of the properties and methods just delegate the call to ChildPage.XXX Returns either the root-most init page, or the provided page itself if no init page is found This is a wrapper around PageDataDictionary[[dynamic]] which allows dynamic access (e.g. dict.Foo). Like PageDataDictionary, it returns null if the key is not found, instead of throwing an exception. This class is intended to be used as DynamicPageDataDictionary[[dynamic]] Wraps HTML markup in an IHtmlString, which will enable HTML markup to be rendered to the output without getting HTML encoded. HTML markup string. An IHtmlString that represents HTML markup. Wraps HTML markup from the string representation of an object in an IHtmlString, which will enable HTML markup to be rendered to the output without getting HTML encoded. object with string representation as HTML markup An IHtmlString that represents HTML markup. Creates a dictionary of HTML attributes from the input object, translating underscores to dashes. new { data_name="value" } will translate to the entry { "data-name" , "value" } in the resulting dictionary. Anonymous object describing HTML attributes. A dictionary that represents HTML attributes. The application level storage context that uses a static dictionary as a backing store. Initializes a new instance of the class. The base scope. The dictionary to use as a storage. Since the dictionary would be used as-is, we expect the implementer to use the same key-value comparison logic as we do here. Custom comparer for the context dictionaries The comparer treats strings as a special case, performing case insesitive comparison. This guaratees that we remain consistent throughout the chain of contexts since PageData dictionary behaves in this manner. TemplateFileInfo specifies properties of a template such as VirtualPath. This type allows us to modify the behavior of ITemplateFile between releases without changing the interface. Template stacks store a stack of template files. WebPageExecutingBase implements this type, so when executing Plan9 or Mvc WebViewPage, the stack would contain instances of the page. The stack can be queried to identify properties of the current executing file such as the virtual path of the file. Path.GetExtension performs a CheckInvalidPathChars(path) which blows up for paths that do not translate to valid physical paths but are valid paths in ASP.NET This method is a near clone of Path.GetExtension without a call to CheckInvalidPathChars(path); Determines true if the path is simply "MyPath", and not app-relative "~/MyPath" or absolute "/MyApp/MyPath" or relative "../Test/MyPath" True if it is a not app-relative, absolute or relative. This is a wrapper around Dictionary so that using PageData[key] returns null if the key is not found, instead of throwing an exception. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The provided anti-forgery token failed a custom data check.. Looks up a localized string similar to The provided anti-forgery token was meant for a different claims-based user than the current user.. Looks up a localized string similar to The required anti-forgery cookie "{0}" is not present.. Looks up a localized string similar to The anti-forgery token could not be decrypted. If this application is hosted by a Web Farm or cluster, ensure that all machines are running the same version of ASP.NET Web Pages and that the <machineKey> configuration specifies explicit encryption and validation keys. AutoGenerate cannot be used in a cluster.. Looks up a localized string similar to The required anti-forgery form field "{0}" is not present.. Looks up a localized string similar to The anti-forgery cookie token and form field token do not match.. Looks up a localized string similar to Validation of the provided anti-forgery token failed. The cookie "{0}" and the form field "{1}" were swapped.. Looks up a localized string similar to The provided anti-forgery token was meant for user "{0}", but the current user is "{1}".. Looks up a localized string similar to The anti-forgery system has the configuration value AntiForgeryConfig.RequireSsl = true, but the current request is not an SSL request.. Looks up a localized string similar to The assembly "{0}" is already registered.. Looks up a localized string similar to An application module is already registered for virtual path "{0}".. Looks up a localized string similar to Unable to find an application module with the name "{0}".. Looks up a localized string similar to The assembly "{0}" is not a registered application module.. Looks up a localized string similar to The resource file "{0}" could not be found.. Looks up a localized string similar to A claim of type '{0}' was not present on the provided ClaimsIdentity.. Looks up a localized string similar to A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' or 'http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider' was not present on the provided ClaimsIdentity. To enable anti-forgery token support with claims-based authentication, please verify that the configured claims provider is providing both of these claims on the ClaimsIdentity instances it generates. If the configured claims provider instead uses a different claim type as a unique identif [rest of string was truncated]";. Looks up a localized string similar to Index length must be exactly one.. Looks up a localized string similar to Index must be of type string or int when getting a value.. Looks up a localized string similar to Index must be of type string when setting a value.. Looks up a localized string similar to The parameter conversion from type "{0}" to type "{1}" failed. See the inner exception for more information.. Looks up a localized string similar to The parameter conversion from type "{0}" to type "{1}" failed because no type converter can convert between these types.. Looks up a localized string similar to An HttpContext is required to perform this operation. Check that this operation is being performed during a web request.. Looks up a localized string similar to Value "{0}" specified in "{1}" is an invalid value for the SessionState directive. Possible values are: "{2}".. Looks up a localized string similar to At most one SessionState value can be declared per page.. Looks up a localized string similar to RequestScope cannot be created when _AppStart is executing.. Looks up a localized string similar to Storage scope is read only.. Looks up a localized string similar to Storage scopes cannot be created when _AppStart is executing.. Looks up a localized string similar to The provided identity of type '{0}' is marked IsAuthenticated = true but does not have a value for Name. By default, the anti-forgery system requires that all authenticated identities have a unique Name. If it is not possible to provide a unique Name for this identity, consider setting the static property AntiForgeryConfig.AdditionalDataProvider to an instance of a type that can provide some form of unique identifier for the current user.. Looks up a localized string similar to Validation parameter names in unobtrusive client validation rules cannot be empty. Client rule type: {0}. Looks up a localized string similar to Validation parameter names in unobtrusive client validation rules must start with a lowercase letter and consist of only lowercase letters or digits. Validation parameter name: {0}, client rule type: {1}. Looks up a localized string similar to Validation type names in unobtrusive client validation rules cannot be empty. Client rule type: {0}. Looks up a localized string similar to Validation type names in unobtrusive client validation rules must consist of only lowercase letters. Invalid name: "{0}", client rule type: {1}. Looks up a localized string similar to Validation type names in unobtrusive client validation rules must be unique. The following validation type was seen more than once: {0}. Looks up a localized string similar to The UrlData collection is read-only.. Looks up a localized string similar to Input format is invalid.. Looks up a localized string similar to Values do not match.. Looks up a localized string similar to Value must be a decimal between {0} and {1}.. Looks up a localized string similar to Value must be an integer between {0} and {1}.. Looks up a localized string similar to Value is invalid.. Looks up a localized string similar to This field is required.. Looks up a localized string similar to Max length: {0}.. Looks up a localized string similar to String must be between {0} and {1} characters.. Looks up a localized string similar to The file "{0}" cannot be requested directly because it calls the "{1}" method.. Looks up a localized string similar to The following file could not be rendered because its extension "{0}" might not be supported: "{1}".. Looks up a localized string similar to The file "{0}" could not be rendered, because it does not exist or is not a valid page.. Looks up a localized string similar to The layout page "{0}" could not be found at the following path: "{1}".. Looks up a localized string similar to The "RenderBody" method has already been called.. Looks up a localized string similar to The "RenderBody" method has not been called for layout page "{0}".. Looks up a localized string similar to Section already defined: "{0}".. Looks up a localized string similar to The "RenderSection" method has already been called for the section named "{0}".. Looks up a localized string similar to Section not defined: "{0}".. Looks up a localized string similar to The following sections have been defined but have not been rendered for the layout page "{0}": "{1}".. Looks up a localized string similar to Files with leading underscores ("_") cannot be served.. Attempts to create a WebPageBase instance from a virtualPath and wraps complex compiler exceptions with simpler messages