可以在类库中拥有用户组件并从该库中调用它们吗?
有没有办法获得关注?
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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能将用户控件放在单独的库中,因为它们需要位于 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.