Last post May 29, 2013 03:23 PM by ninianne98
May 29, 2013 04:38 AM|TPlatz|LINK
We have a webapp, where a few usercontrols are rather specific for the individual deployments/customers. I'm now trying to make the configuration as simple as possible, by registering the usercontrol in the page, but getting the src/path from appsettings.
In appSettings.config I have
<add key="IndividualMappingsSourceFile" value="~/Controls/ConfigMappingsIndividual.ascx" />
but in the ASPX i have tried several approaches/syntaxes, like
<%@ Register Src="<%$appSettings:IndividualMappingsSourceFile %>" TagPrefix="wpm" TagName="ConfigMappingsIndividual" %>
I expect this to be rather simple, but I don't seem to be able to get the correct syntax. Can anyone help me out here?
May 29, 2013 03:23 PM|ninianne98|LINK
consider building a simple server control that reads that web.config entry and it's sole job is loading/rendering the usercontrol, expose/forward property/function calls by way of the server control, use/reference the server control in your aspx/master files,
only reference the user control inside the server control code.