Configure asp.net Web Controls in external configuration file
<p>I've an asp.net web application accessed by different users with different roles.</p>

<p>Now I've to enable/disable and show/hide controls (label, textbox, buttons in grid, third party controls) based on a logic involves context variables and users role.</p>

<p>I want to avoid to write IF statements in <code>onLoad</code> method. </p>

<p>I tried to create an xml file like this:</p>

<pre><code>&lt;root&gt;
   &lt;page name="page1" mode="insert"&gt;
       &lt;control id="txtName" property="Visible" value="True" /&gt;
</code></pre>

<p>then in a <code>basePage</code> class I tried to cycle all <code>Page.Controls</code> to set property with propertyInfo.</p>

<p>Problems starts when I have ascx inside ascx or gridview with command buttons to disable.   </p>

<p>It is possible to configure those control's behaviors in an external configuration file?</p>

<p>Is there a framework allowing this?  </p>
