主题:请教一个关于用户自定义控件的问题
Simple.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>");
}
}
}
Simple.aspx如下:
<%@ 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>
在VS2003中提示创建控件时出错!是啥子问题?
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>");
}
}
}
Simple.aspx如下:
<%@ 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>
在VS2003中提示创建控件时出错!是啥子问题?