|
-
Nov 25th, 2008, 05:59 AM
#1
Thread Starter
Fanatic Member
Dynamically loading WebUserControl
Hi there,
im having an issue dynamically loading a webusercontrol.
In my vs2008 solution i have several projects. their is the main web project, then several other projects that are controls to be used in the main project.
In the main web application when a user requests a page it will dynamically load a WebUserControl in on of these other projects, based on a supplied Id in the querystring.
I publish each project that has a webusercontrol to a directory called controls under the main project.
ie:
c:\inetpub\wwwroot\MyWebProject
c:\inetpub\wwwroot\MyWebProject\Controls
so when i try and load a web control to my default aspx page i do the following
Dim defaultCtrl As Control = LoadControl("~/Controls/DefaultWebControl/newPage.ascx")
me.Controls.Add(defaultCtrl)
however i keep gettin an exception saying "Could not load type XXXXXX"
and the exception is of httpparser.
this is very frustrating, i cant see why this doesnt load.
if i try load the webusercontrol into a aspx page in the same project it will load. But it will not load for my main project..
Thanks for any help
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|