可以在类库中拥有用户组件并从该库中调用它们吗?

发布于 2024-12-11 03:14:17 字数 354 浏览 0 评论 0原文

有没有办法获得关注?

CLASS

  • ucComponent.ascx
  • Component.cs

,然后在 Component.cs 中动态创建组件,生成内容并发送到将其作为最终字符串调用的程序。

CLASS tmpClass = new CLASS();
string strResult = string.Empty;
strResult = tmpClass.Generate();

这是为什么?我希望在类库和客户端上有统一的组件生成内容并使用 CSS 进行样式设置。

谢谢

Is there a way to have following ?

CLASS

  • ucComponent.ascx
  • Component.cs

and then within Component.cs to dynamically create component, generate content and send to program which called it as finalized string.

CLASS tmpClass = new CLASS();
string strResult = string.Empty;
strResult = tmpClass.Generate();

Reason for this? I want to have unified components within class library and on client-end generate content and use CSS for styling.

Thanks

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

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

发布评论

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

评论(1

梦幻的味道 2024-12-18 03:14:17

您不能将用户控件放在单独的库中,因为它们需要位于 Web 应用程序项目中的 ASCX 标记文件。

You cannot have user controls in a separate library, because of the ASCX markup file they need to sit in the web app project.

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