Microsoft.Web.Administration.ConfigurationElement.GetAttributeValue C# (CSharp) Method

GetAttributeValue() public method

public GetAttributeValue ( string attributeName ) : object
attributeName string
return object
        public object GetAttributeValue(string attributeName)
        {
            return this[attributeName];
        }

Usage Example

		private HttpError GetHttpError(ConfigurationElement element, WebVirtualDirectory virtualDir)
		{
			if (element == null || virtualDir == null)
				return null;
			// skip inherited http errors
			if (!element.IsLocallyStored)
				return null;
			//
			var error = new HttpError
			{
				ErrorCode		= Convert.ToString(element.GetAttributeValue(StatusCodeAttribute)),
				ErrorSubcode	= Convert.ToString(element.GetAttributeValue(SubStatusCodeAttribute)),
				ErrorContent	= Convert.ToString(element.GetAttributeValue(PathAttribute)),
				HandlerType		= Enum.GetName(typeof(HttpErrorResponseMode), element.GetAttributeValue(ResponseModeAttribute))
			};

			// Make error path relative to the virtual directory's root folder
			if (error.HandlerType.Equals("File") // 0 is supposed to be File
				&& error.ErrorContent.Length > virtualDir.ContentPath.Length)
			{
				error.ErrorContent = error.ErrorContent.Substring(virtualDir.ContentPath.Length);
			}
			//
			return error;
		}
All Usage Examples Of Microsoft.Web.Administration.ConfigurationElement::GetAttributeValue