在WebCustomControl1.cs定义了WebCustomControl1
然后在web页引用
<%@ Register TagPrefix="Custom" Namespace="test" Assembly = "WebCustomControl1" %>
找不到文件或程序集名称“WebCustomControl1”,或找不到它的一个依赖项。
然后在web页引用
<%@ Register TagPrefix="Custom" Namespace="test" Assembly = "WebCustomControl1" %>
找不到文件或程序集名称“WebCustomControl1”,或找不到它的一个依赖项。
在页面写上<Custom:WebCustomControl1 id=w1 runat=server/>
出现错误
CS1595: 已在多处定义“test.WebCustomControl1”;使用“c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\test\1aeb13a2\70ec1340\assembly\dl2\43e18bc9\00eab407_0f60c501\WebCustomControl1.DLL”中的定义
能不能说一下步骤
我的VS2003根本就不会自动编译WebCustomControl1.cs文件
using System;
using System.Web;
using System.Web.UI;
namespace SimpleControlSamples {
public class Simple : Control {
protected override void Render(HtmlTextWriter output) {
output.Write("<H2>欢迎使用控件开发!</H2>");
}
}
}
web页
<%@ Register TagPrefix="SimpleControlSamples" Namespace="SimpleControlSamples" Assembly="SimpleControlSamples" %>
<html>
<body>
<form method="POST" action="Simple.aspx" runat=server>
<SimpleControlSamples:Simple id="MyControl" runat=server/>
</form>
</body>
</html>
但就是不行