Last post Oct 16, 2008 10:20 PM by Thomas Sun – MSFT
Oct 13, 2008 03:43 AM|min0|LINK
Hi guys. I got some problems.
I added a web deployment project and merged a single assembly. Let's say "web_deploy.test.dll".
This project has 3 webusercontrols.
After deploying this project, I opend new web site and added a reference, "web_deploy.test.dll". I wanted to reuse these webusercontrols, so I tried to call one of controls.
TestControl.ascx in Deployed project
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TestControl.ascx.cs" Inherits="Controls.Test.TestControl" %>
<input type="text" value="aaa" />
<input type="button" value="click" onclick="alert('test')" />
Default.aspx in New web site
<%@ Register TagPrefix="Test" Namespace="Controls.Test" Assembly="web_deploy.test" %>
<Test:TestControl ID="aaa" runat="server" />
But there is noting to diplay. Am I missing something? Is it possible to reuse controls after deploying?
Let me know what problem is.
Oct 16, 2008 10:20 PM|Thomas Sun – MSFT|LINK
To reuse this Web Control, we need to set this website to non-updateable in Web Deployment project.
In your case, please make sure the Namespace and Assembly are correct in the Register section. We can check this assembly using Reflector (http://www.softpedia.com/get/Programming/Other-Programming-Files/Lutz-Roeder-s-NET-Reflector.shtml).
Based on my test, this Web User Control cannot be seen in the design mode. I think it is working like Custom Control.
I look forward to hearing from you.