Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# adrian.libotean 5/30/2006 12:11 AM
Hello,

I'm using Cuyahoga with ASP.Net 2.0 on VS2005 and created some custom modules that I then inherit into more specialized versions. The problem is that when the user control is instantiated all the web controls defined in the inherited .ascx are set to null, I believe that this is due to the way Cuyahoga instantiates the module control (using the path to the .ascx and not the type):
BaseModuleControl ctrl = (BaseModuleControl)this.LoadControl(UrlHelper.GetApplicationPath() + module.CurrentViewControlPath);

If someone knows a way to make this work please let me know. Thanks.

Adrian
# martijnb 5/30/2006 9:44 AM
Which .ascx control is loaded with LoadControl()? The specialized version or the base?

On a side note: you mention instantiating a user control from the type. Is that possible?
# adrian.libotean 5/31/2006 7:10 AM
The specilized version of the .ascx is set in the modules tables and loaded. Yes from .NET 2.0 it's possible (at least this is what I've found on the MSDN).
# martijnb 5/31/2006 1:11 PM
Allright, I'm afraid I don't have the direct answer for your problem. Maybe someone else?

But, I'll have a look at the MSDN docs. Instantiating module control without LoadControl(), but directly from the type can offer some interesting possibilities. Thanks for the hint :).
# adrian.libotean 6/1/2006 12:47 AM
Sorry for not being specific: what I meant was that from .Net 2.0 there is an overloaded method for LoadControl that instantiates the control by type and constructor parameters. Here's the link to MSDN:

http://msdn2.microsoft.com/en-us/library/system.web.ui.templatecontrol.loadcontrol.aspx