AspNetHostingPermissionAttribute

AspNetHostingPermissionAttribute.NET 1.1, serializable

System.Web (system.dll)sealed class

With this attribute, you can ensure that the current assembly has the required code access security permission to host the ASP.NET engine. If it does not, a System.Security.SecurityException will be thrown immediately (which prevents the problem of an unexpected security-related failure later on). This attribute serves the same purpose as the AspNetHostingPermission class. The difference is that while AspNetHostingPermission must be used programmatically (by creating an instance and invoking the corresponding method), AspNetHostingPermissionAttribute is used declaratively, by adding the attribute to an assembly or code construct like a class or method declaration.

Note that this type only pertains to code access security (the policy of allowed and disallowed actions configured using the .NET Framework Configuration Tool or the caspol.exe command-line utility). It has nothing to do with ASP.NET or IIS authentication. It will also not be of any interest if you are using IIS to host the ASP.NET engine.

public sealed class AspNetHostingPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute { // Public Constructors    public AspNetHostingPermissionAttribute(System.Security.Permissions.SecurityAction action); // Public Instance Properties    public AspNetHostingPermissionLevel Level{set; get; } // Public Instance Methods    public override IPermission CreatePermission( );  // overrides System.Security.Permissions.SecurityAttribute }

Hierarchy

System.Object System.Attribute System.Security.Permissions.SecurityAttribute System.Security.Permissions.CodeAccessSecurityAttribute AspNetHostingPermissionAttribute

Valid On

All



ASP. NET in a Nutshell
ASP.NET in a Nutshell, Second Edition
ISBN: 0596005202
EAN: 2147483647
Year: 2003
Pages: 873

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net