Controlling page elements from a .config file
-
Is there a way to create a config file that controls the elements on specific pages. For example I have 2 pages viz. page1.aspx and page2.aspx. I want to have a config file in which I can control the visible property of the textbox controls on both pages. Something like this:-
<page id = "page1.aspx">
<controls> <control1 ID = "Textbox1" Visible = "false"> </controls>
</page>
<page id = "page2.aspx"><controls> <control1 ID = "Textbox1" Visible = "true"> </controls>
</page>
-
Is there a way to create a config file that controls the elements on specific pages. For example I have 2 pages viz. page1.aspx and page2.aspx. I want to have a config file in which I can control the visible property of the textbox controls on both pages. Something like this:-
<page id = "page1.aspx">
<controls> <control1 ID = "Textbox1" Visible = "false"> </controls>
</page>
<page id = "page2.aspx"><controls> <control1 ID = "Textbox1" Visible = "true"> </controls>
</page>
Well, you could create an HttpModule that reads the config file, identifies the current page, and injects a Load or PreRender event handler to hide or display controls. Can I ask why you would want to do this? What's wrong with setting the property on the page?