创建动态 html 菜单 Web 部件

发布于 2024-11-15 16:43:07 字数 404 浏览 8 评论 0原文

我想在 Visual Studio 2010/2008 环境中使用微软提供的 sharepoitn 扩展创建 webpart。我有一个集合,就像

Home      |As Parent |
Management|As Parent |
SubHome1  | As Child |  Child of Home
SubHome2  | As Child |  Child of Home
Download  |As Parent | 

我想一项一项地迭代一样。说这是数据表。如果在父项中列出项目,则需要动态添加菜单项,如果它是子项,则需要将其作为子菜单项添加到相应的菜单项中。我想用 c# 编写代码。我知道只有我们可以使用 HTMLGenericControl 类在 C# 中创建 html 控件。如何实现这一目标?请指导。

I want to create the webpart in Visual studio 2010/2008 environment with microsoft given sharepoitn extensions. I have collection like

Home      |As Parent |
Management|As Parent |
SubHome1  | As Child |  Child of Home
SubHome2  | As Child |  Child of Home
Download  |As Parent | 

I want to iterate one by one item. say this is datatable. if Lits item in Parent then need to dynamically add Menu item , if it is child , then want to add as sub menu item to respective menu item. I want to write code in c#. I know only we can create the html control in c# using HTMLGenericControl class. how to achieve this ? please guide.

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

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

发布评论

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

评论(1

掩饰不了的爱 2024-11-22 16:43:07

您可以使用用户控件并将数据绑定到用户控件。在用户控件中,您可以读取数据源并构建菜单所需的 javascript/html。您可以使用 JQuery 构建导航菜单。 JQuery 中有太多可用的菜单插件。

http://designm.ag/resources/jquery-navigation-plugins/

You can use a user control and bind the data to the user control. In the user control you can read the datasource and build the javascript/html required for the menu. You can use JQuery to build the navigation menu. There are too many menu plugins available in JQuery.

http://designm.ag/resources/jquery-navigation-plugins/

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