I했습니다 http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.aspx에서 수정 아래에있어 코드 :셰어 사용자 지정 웹 파트
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 웹 파트로이 코드를 사용하는 좀 도와 주 시겠어요?
- 이것을 웹 파트로 공유 지점에 배포하는 방법은 무엇입니까?
- 위의 RenderWebPart 메서드는 어떻게 사용됩니까?
감사합니다는 WebPart를 만들거나 우리가 명시 적으로 호출 할 필요가 수행하는 방법을 보여주는 (사진과 함께) 좋은 자습서? –
안녕하세요 @ 루크 McGregor 위의 쿼리를 위의 쿼리를 명확하게 할 수 있다면 –
모두 CreateChildControls 및 RenderWebPart는 ASP.Net \ SharePoint에 의해 자동으로 호출됩니다. Render를 last라고하고 페이지에 표시 할 html을 출력합니다. – justforkix09