title: Read value of another property in asp.net mvc2 custom attribute?
body: <p>I have made custom attribute in my asp.net mvc2 project:</p>
  
  <pre><code>[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
  public class IsUsernameValidAttribute : ValidationAttribute
  {
      public override bool IsValid(object value)
      {
          if (value == null)
          {
              return true;
          }
  
          var username = value.ToString();
  
          return UserBusiness.IsUsernameValid(username) 
  // &amp;&amp; value of OtherProperty == true;
      }
  }
  </code></pre>
  
  <p>for the model:</p>
  
  <pre><code>public class MyClass
  {
      [IsUsernameValid]
      public string UserName { get; set; }
  
      public bool OtherProperty { get; set; }
  }
  </code></pre>
  
  <p>I can get value of UserName, but can I get value of OtherProperty inside custom attribute and use it in return clause and how. Thanks in advance.</p>