我可以在没有控件声明的情况下将 ASP.NET 用户控件放置在页面上吗?

发布于 2024-07-17 21:02:07 字数 238 浏览 6 评论 0原文

我想将用户控件放在页面上,而不在页面顶部注册标签。 例如:

<p>some text</p>
<myname:mycontrol runat="server" />

这可能吗? 我听说标签声明可以在 web.config 中完成...这是真的吗?

如果是这样,您知道哪些 .NET 框架版本支持此功能吗?

谢谢

I would like to put user controls on pages without registering the tag at the top of the page. For example:

<p>some text</p>
<myname:mycontrol runat="server" />

Is this possible? I've heard that tag declarations can be done in web.config... is this true?

If so, any idea which .NET framework versions support this?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江南烟雨〆相思醉 2024-07-24 21:02:07

在 .net 2.0 web.config 中:

<pages>
    <controls>
    <add tagPrefix="MYPREFIX" namespace=="MyNamespace.Stuff" assembly="MyAssembly" />

更彻底的讨论 http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-在 web-config.aspx 中注册用户控件和自定义控件

in .net 2.0 web.config :

<pages>
    <controls>
    <add tagPrefix="MYPREFIX" namespace=="MyNamespace.Stuff" assembly="MyAssembly" />

Much more thorough discussion http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文