本文介绍了定制Web部件(定制目录)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在自定义布局中建立零件目录:

而不是带有复选框的可用零件列表,区域的下拉列表和添加到"按钮,我需要带有复选框的可用零件列表以及一个添加"按钮(没有区域的下拉列表).此添加按钮会将选定的零件添加到特定区域.

谁能给我一些有关如何自定义此内容的指导?


感谢

I need to have a catalog of my parts in a custom layout:

Instead of a list of available parts with checkboxes, the dropdownlist of the zones and the "add to" button, I need a list of available parts with checkboxes and just an "add" button (without the dropdownlist of the zones). This add button will add the selected parts to a specific zone.

Can anyone give me some directions on how to customize this?


Thanks

推荐答案

Control c1 = LoadControl("Path of your User Control based on the checkbox selected");
c1.ID = "some unique id";

GenericWebPart gwp1 = this.WidgetManager.CreateWebPart(c1);
gwp1.Title = "Title of the webpart";

    WidgetManager.AddWebPart(gwp1, "variable name of the specific web part zone i.e. LeftZone or something", 0);



最后隐藏面板/用户控件.



and at the end Hide the panel/user control.



这篇关于定制Web部件(定制目录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 14:12