views:

1148

answers:

1

In ASP.NET 2.0 it is my understanding that although the API existed for loading a user control by type, it didn't actually work.

Or at least I never managed to get it to work, and I know from blogs that others have had similar issues.

So I use a wrapper type that provides the functionality I need, invoking the relevant control constructor using reflection.

Has ASP.NET 3.5 made the loading of user controls by type and passing in parameters any easier?

Edit:

Further clarification....

There are two overloads for the TemplateControl.LoadControl method:

Control TemplateControl.LoadControl(Type t, object[] params) and,

Control TemplateControl.LoadControl(string virtualPath)

My question is; in ASP.NET 2.0 the first overload didn't seem to work. Does anyone know if this method truly didn't work, and if so has it been fixed in ASP.NET 3.5.

I'll be testing this myself tomorrow, and will update the question with the answer if noone else knows.

A: 

Answering my own question:

Answer here: http://stackoverflow.com/questions/240850/aspnet-usercontrol-loadcontrol-issue

Ben Aston