最近有个新需求,用户希望标题栏可以拖动宽度,其实觉得没什么用,既然用户要了又推不掉,就勉为其难实现一下吧。 其实原理比较简单,就是利用JavaScript对标题栏进行宽度控制,然后从网......
2021-06-25 168 SharePoint列表标题列宽度可拖动
异构应用访问SharePoint的文档库或列表时,使用WebService的方式再恰当不过了。有朋友问我如何在dotNet Framework 3.0下的应用程序中控制SharePoint 2003中的列表项。想一想类似的场景应该比较常见,所以写了下面的demo。以下的代码在VS2005中测试通过。
using System;
using System.Xml;
using System.Collections.Generic;
using System.Text;
namespace ConsoleDemo
{
class Program
{
static void Main(string[] args)
{
try
{
test();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.WriteLine("END");
Console.Read();
}
private static void test()
{
LabPortal.Lists listService = new ConsoleDemo.LabPortal.Lists();
listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
string strBatch = "<Method ID='1' Cmd='New'>"+ //
//ID是Method的唯一标识,如果有多个Method就都列在下面
//Cmd的类型有:New,Update,Delete。分别对应增加,删除,更新
"<Field Name='ID'>New</Field>"+ //
//ID在增加操作时只是个唯一标记,可以随便指定,并不对应到实际
//listitem的ID。但在删除和更新时就必须是实际的ID了,因为要靠这个来唯一指定一条记录
"<Field Name='Title'>Smf</Field>"+
"</Method>";
XmlDocument xmlDoc = new XmlDocument();
XmlElement elBatch = xmlDoc.CreateElement("Batch");
//Batch元素下面的这些Attribue是可选的
elBatch.SetAttribute("OnError", "Continue"); //指定出错后是返回还是继续下一步
elBatch.SetAttribute("ListVersion","1"); //指定列表的版本
elBatch.SetAttribute("ViewName", "654446D3-8E70-4483-B2B6-F87329EAC2D9"); //指定所操作的列表视图GUID
elBatch.InnerXml = strBatch;
XmlNode ndReturn = listService.UpdateListItems("Contracts", elBatch); //在名为Contracts的联系人列表中增加一条记录
Console.WriteLine(ndReturn.OuterXml);
}
}
}
相关文章
最近有个新需求,用户希望标题栏可以拖动宽度,其实觉得没什么用,既然用户要了又推不掉,就勉为其难实现一下吧。 其实原理比较简单,就是利用JavaScript对标题栏进行宽度控制,然后从网......
2021-06-25 168 SharePoint列表标题列宽度可拖动
本文介绍如何在Office 365中设置SharePoint Online网站集,当我们创建好SharePoint Online站点,开始使用之前,一定会有一些基本的设置,本文就为大家介绍这些基本的设置。 通过登录地址登录到Offi......
2021-06-25 980 SharePoint设置网站集
本文介绍如何在Office 365中创建资产库库,以及资产库的一些基本设置。 通过登录地址登录到Office 365的SharePoint Online站点中,我们可以在右上角的设置菜单中,选择添加应用程序; 或者,进入......
2021-06-25 290 SharePoint创建资产库
本文介绍如何在SharePoint表单登陆中添加表单用户,前提是已经配置了表单认证,如果没配置表单登陆,需要先配置表单登陆; 1. 打开Visual Studio,如下图: 2. 新建一个项目 3. 选择asp.net空web应......
2021-06-25 198 SharePoint表单认证创建用户
SharePoint 开启网站匿名,需要先开启web application的匿名访问,然后开启site的匿名访问。特别的,site可以选择整个网站开启或者列表和库开启匿名,如果选择列表和库开启匿名,还需要对相应列......
2021-06-25 965 SharePoint开启网站匿名访问