zoukankan      html  css  js  c++  java
  • 在SPS2003 中 通过编程的方式来创建SPWEB的问题

        项目需要在SPS 2003中想通过编程的方式来创建一个站点,代码如下:

           SPWeb _web = new SPSite("http://192.168.0.8:8081/sites/gas").OpenWeb();
           _web.AllowUnsafeUpdates = true;         
           SPWeb newWeb = _web.Webs.Add("qy", "qy", "qy", 1033, "STS#2", false, false);

        运行代码会出现以下错误:
         “
    Microsoft.SharePoint.SPException: 此网页的安全性验证无效并且可能损坏。请单击 Web 浏览器中的“后退”,刷新网页,再重试操作。”
        调用堆栈错误信息为:
       
    “在 Microsoft.SharePoint.Library.SPRequestInternalClass.CreateWeb(String bstrUrl, String bstrTitle, String bstrDescription, UInt32 nLCID, String bstrWebTemplate, Boolean bCreateUniqueWeb, Boolean bConvertIfThere)
        在 Microsoft.SharePoint.Library.a.a(String A_0, String A_1, String A_2, UInt32 A_3, String A_4, Boolean A_5, Boolean A_6) ”

        请问这是什么原因,以前也遇到过这样的问题,将AllowUnsafeUpdates的属性设为:true就OK了,可是这次无论如何都不行。请教!!!!
        
      

  • 相关阅读:
    Python-枚举
    Python-函数
    Python-装饰器(语法糖)上下五千年和前世今生
    Python-全局函数(内置方法、内置函数)
    Python-时间模块-time
    Python-随机模块-random
    Python-维护排序好的序列模块-bisect
    需求推动技术的产生
    RBF神经网络
    聚类算法的衡量指标
  • 原文地址:https://www.cnblogs.com/qy1141/p/581442.html
Copyright © 2011-2022 走看看