title: RequiredIf Conditional Validation in MVC3
body: <p>i was reading a small code for RequiredIf Conditional Validation in MVC3 and the code as follows.</p>
  
  <pre><code>string depProp = context.Controller.ViewData.TemplateInfo.GetFullHtmlFieldId(this.DependentProperty);
  
  public class Person
  {
         [RequiredIf("Address.Country", "USA", ErrorMessage = "SSN required for US citizens.")]
         [RegularExpression(@"^\d{9,9}$", ErrorMessage = "Numbers only please.")]
         public string SSN { get; set; }
         public Address Address { get; set; }
  }
  </code></pre>
  
  <p>1) first of all i like to know at all any in-built attribute called <code>RequiredIf</code> is available in mvc 3 ?</p>
  
  <p>2) if not then how we can create this attribute which will emit right js at client end which show the validation message.</p>
  
  <p>3) what is the meaning of this below line</p>
  
  <pre><code>string depProp = context.Controller.ViewData.TemplateInfo.GetFullHtmlFieldId(this.DependentProperty);
  </code></pre>