title: Set DropDownList selected value on master page from child page
body: <p>Attempting something like</p>
  
  <pre><code>public string MyText { get {return lbl.Text;} set {lbl.Text = value;}}
  </code></pre>
  
  <p>taken from <a href="https://stackoverflow.com/questions/2371098/how-to-change-master-page-value-from-child-page">this question</a> ends in an exception:</p>
  
  <pre><code>public string change_ddlArea { get { return ddlArea.SelectedItem.Text; } set { ddlArea.Items.FindByValue(value).Selected = true; } }
  </code></pre>
  
  <blockquote>
    <p>--> Object reference not set to an instance of an object.</p>
  </blockquote>
  
  <p>Using these normally cause the same error:</p>
  
  <pre><code>this.ddlEnergyType.Items.FindByValue(resourceTypeVal).Selected = true;
  ((DropDownList)Master.FindControl("ddlArea")).Items.FindByValue("all").Selected = true;
  </code></pre>
  
  <p>I'm having difficulty finding an answer to this problem on google. It <em>should</em> work, given if a label manipulation does, moving to a ddl would as well?</p>
  
  <p>The one difference that could be the problem is when trying to call this.. (in the 2nd code block) I use </p>
  
  <pre><code>Master.change_ddlArea = sendoff_area;
  </code></pre>
  
  <p>and in the aformentioned link it is done like so</p>
  
  <pre><code>((MasterPageTypeName)Page.MasterPage ).MyText = "test";
  //so mine would look like this:
  ((GAWMaster)_default.Master).change_ddlArea = "all";
  </code></pre>
  
  <p>however intellisense is missing the '.Master' - putting it in causes the information to appear: an object reference is required for the non-static field, method or property....</p>
  
  <p>tl,dr: halp</p>