Last post Oct 19, 2009 10:23 AM by Thomas Sun – MSFT
Oct 15, 2009 06:01 AM|jj011185|LINK
Hi all, I'm kinna having a hard time referencing the assembly compiled by the Web Deployment Project.
see, I have a website project with a usercontrol and wanted to re use this in another website, so I compiled the project using web deployment project using this option
-> Create a separate assembly for each page and control output.
so I have these as a result after i built it.
the usercontrol has this default namespace "IAmAUserControl.UserControls"
App_Web_default.aspx.cdcab7d2.dll -> default.aspx
App_Web_iamausercontrol.ascx.6bb32623.dll -> iamausercontrol.ascx
1. if i wanted to re-use the iamausercontrol.ascx control which files do i need to copy to the other web app's bin directory?
2. Do I still need to reference the IAmAUserControl.dll to my second web project?
3. How do I place the reference tags in the web.config file.
would it be like so?
<%@ Register Assembly="App_Web_iamausercontrol.ascx.6bb32623" Namespace="ASP.usercontrols_iamausercontrol_ascx" TagName="iamausercontrol" TagPrefix="mycontrol" %>
I can't seem to figure out the namespace to use.
Any help would be great. thanks.
Oct 19, 2009 10:23 AM|Thomas Sun – MSFT|LINK
You need to compile Custom User Control's HTML and source code into assembly. Please disable "Allow this precompiled site to be updatable" option in Web Deployment project. Then you can use just like using another Custom Usercontrol.
For more information, see
http://msdn.microsoft.com/en-us/magazine/cc163448.aspx (Especially in section: Creating Reusable User Controls).