我有一個有一個的代碼段從以下修改http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.aspx:的Sharepoint自定義Web部件
public class WebPartBla : Microsoft.SharePoint.WebPartPages.WebPart
{
private ArrayList someList;
protected override void CreateChildControls()
{
someList = new ArrayList();
SPWeb myWeb = SPControl.GetContextWeb(this.Context);
foreach(SPList list in myWeb.Lists)
{
if (list.BaseTemplate == SPListTemplateType.Tasks)
{
someList(list.Description);
}
}
}
/// <summary>
/// Render this Web Part to the output parameter specified.
/// </summary>
/// <param name="output"> The HTML writer to write out to </param>
protected override void RenderWebPart(HtmlTextWriter output)
{
string strHTML = "";
for (int i = 0; i < someList.Count; i++)
{
strHTML = strHTML + "The task " + someList.Description + "<BR><BR>";
}
output.Write(strHTML);
}
}
任何人都可以請幫我
- 如何使用此代碼的SharePoint Web部件?
- 如何將此部署作爲Web部件部署到Sharepoint?
- 如何使用上面的RenderWebPart方法?
謝謝你,不renderWebPart方法獲取由SharePoint引擎調用還是我們需要明確地打電話? – 2011-12-15 04:37:01