ASP.NET - How to get and set MasterPage attribute in page code behind?
<p>I have an ASP.NET page that uses a MasterPage. I have a <code>public</code> <code>bool</code> attribute in the MasterPage called <code>ShowChangePassword</code>. I want to set this to true or false in the page that uses this MasterPage.</p>

<p>I have the following code, but I can't set the attribute:</p>

<pre><code> var masterPage = this.Master;
 masterPage.ShowChangePassword = false;
</code></pre>

<p>What code do I need to do this?</p>
