摘要: 代码如下:Calling Web Serviceusing System;using System.Runtime.InteropServices;using System.Web.UI;namespace WebPartCollection{ [Guid("d2b37a6c-650c-4ef4-962c-85297f15b0b5")] public class AsyWebServiceWebPart : System.Web.UI.WebControls.WebParts.WebPart, ICallbackEventHandler { public Asy... 阅读全文
posted @ 2011-10-04 22:16 gzh4455 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1. 判断模式:设计模式Design Model protected override void Render(HtmlTextWriter writer) { bool isDesign = this.WebPartManager != null && this.WebPartManager.DisplayMode != WebPartManager.BrowseDisplayMode; if (isDesign) { writer.Write("<div style=... 阅读全文
posted @ 2011-10-04 15:58 gzh4455 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 下面代码是实现一个Dropdown,同时实现其同步变化。代码如下:Complex Propertyusing System;using System.Runtime.InteropServices;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.ComponentModel;using System.Collections;namespace WebPartCollection{ [Guid("cf18e6af-3ab5- 阅读全文
posted @ 2011-10-04 15:48 gzh4455 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 1. Create ListView Code public static bool CreateList(SPWeb web,string listName,string strDescription,SPListTemplateType type,bool IsOnQuickLaunch) { bool result = false; try { web.AllowUnsafeUpdates = true; Guid newListId... 阅读全文
posted @ 2011-10-04 14:56 gzh4455 阅读(263) 评论(0) 推荐(0) 编辑
摘要: Webpart引用UserControl有两种方法:1. 引用QuickPart2. 自己开发出一个WebPart暴露一个引用地址属性。代码如下:View Code using System;using System.Runtime.InteropServices;using System.Web.UI;using System.Web.UI.WebControls.WebParts;namespace WebPartCollection{ [Guid("1c7e7f5f-c4d6-4628-8785-3804bc0f5c85")] public class UserCon 阅读全文
posted @ 2011-10-04 14:23 gzh4455 阅读(268) 评论(0) 推荐(0) 编辑
摘要: WebPart多语言的实现:WPResource.csView Code using System;using System.Web.UI.WebControls.WebParts;using Microsoft.SharePoint;using System.ComponentModel;using System.Web;namespace WebPartCollection.Common{ public static class WPResource { const string RESOURCE_FILE_NAME = "Anson"; /// ... 阅读全文
posted @ 2011-10-04 14:03 gzh4455 阅读(377) 评论(0) 推荐(1) 编辑