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.
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.
Member
55 Points
94 Posts
Registering UserControl with src/path from appSettings
May 29, 2013 04:38 AM|TPlatz|LINK
Hello, everyone.
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
but in the ASPX i have tried several approaches/syntaxes, like
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?
Troels H. Platz
Contributor
4732 Points
1001 Posts
Re: Registering UserControl with src/path from appSettings
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.
http://msdn.microsoft.com/en-us/library/c0az2h86%28v=vs.100%29.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.control.load%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/zt27tfhy%28v=vs.100%29.aspx
Mark as Answer if this response was helpful.