TrustSection.Level Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the name of the security level under which the application will run.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute("level", IsRequired = true, DefaultValue = "Full")]
[StringValidatorAttribute(MinLength = 1)]
public string Level { get; set; }

Property Value

Type: System.String

The name of the trust level. The default is "Full".

The Level property specifies the security level under which the application will be run. The default is "Full".

There are five available trust levels:

  • Full

  • High

  • Medium

  • Low

  • Minimal

The named levels correspond to the security levels that are defined in the <trustLevel> element for <securityPolicy>.

The following code example demonstrates how to use the Level property. This code example is part of a larger example provided for the TrustSection class.

// Display Level property
Console.WriteLine("Level: {0}", configSection.Level);

.NET Framework
Available since 2.0
Return to top