2010-01-04 63 views
0

我最近开始编写用于SharePoint的AJAX Web部件,并且出现奇怪的错误。看起来EnsurePanelFix()导致Web部件抛出401错误;在日志中,401.2和401.3错误都在同一时间出现。我做的就到这里了一些研究和其他一些网站后,做了一些修改EnsurePanelFix(),它是目前如下:SharePoint AJAX Web部件401.2/3错误

void EnsurePanelFix 
{ 
      // Change AJAX doPostBack behavior to fix the update panel. 
      if (this.Page.Form != null) 
      { 
       String fixupScript = @" 
            if (typeof(_spBodyOnLoadFunctionNames) !== 'undefined'){ 
            _spBodyOnLoadFunctionNames.push(""_initFormActionAjax""); 
            function _initFormActionAjax() { 
            if (_spEscapedFormAction == document.forms[0].action){ 
            document.forms[0]._initialAction = 
            document.forms[0].action; 
            } 
            } 

            RestoreToOriginalFormAction = function() { 
            if (_spOriginalFormAction != null) { 
            if (_spEscapedFormAction==document.forms[0].action){ 
            document.forms[0].action=_spOriginalFormAction; 
            } 
            _spOriginalFormAction=null; 
            _spEscapedFormAction=null; 

            document.forms[0]._initialAction = document.forms[0].action; 
            } 
            }; 
            }"; 

       string scriptKey = "UpdatePanelFixup"; 
       if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptKey)) 
        ScriptManager.RegisterStartupScript(this, typeof(SpecDatabaseViewer), scriptKey, fixupScript, true); 

       ScriptManager.RegisterStartupScript(this, 
        typeof(SpecDatabaseViewer), "UpdatePanelFixup", 
        fixupScript, true); 
      } 

看着安全日志中,我看到的失败被记录为这样的:

Event Type: Failure Audit 
Event Source: Security 
Event Category: Object Access 
Event ID:   560 
Date:  1/6/2010 
Time:  11:46:34 AM 
User:  NT AUTHORITY\NETWORK SERVICE 
Computer: SHAREPOINT 
Description: 
Object Open: 
    Object Server: SC Manager 
    Object Type: SERVICE OBJECT 
    Object Name: WinHttpAutoProxySvc 
    Handle ID: - 
    Operation ID: {0,69477107} 
    Process ID: 404 
    Image File Name: C:\WINDOWS\system32\services.exe 
    Primary User Name: SHAREPOINT$ 
    Primary Domain: SPDOMAIN 
    Primary Logon ID: (0x0,0x3E7) 
    Client User Name: NETWORK SERVICE 
    Client Domain: NT AUTHORITY 
    Client Logon ID: (0x0,0x3E4) 
    Accesses: Query status of service 
      Start the service 
      Query information from service 

    Privileges: - 
    Restricted Sid Count: 0 
    Access Mask: 0x94 

有多个失败审核,只有不同的数据是操作ID。

任何人都可以看到任何理由,我会有身份验证或文件权限问题,因为一切工作正常,没有这段代码?谢谢。

编辑:我很确定它与ACL有关,但我不确定在哪里寻找可能导致问题的资源。

回答

0

你能捕捉到,什么URL准确地产生401.x错误?如果您使用Fiddler拦截呼叫,则必须可见。

而且,这种描述似乎很相似,你的情况:http://forums.asp.net/t/1187045.aspx

+0

另外,我确实发生了跨论坛上发帖绊倒以及大卫 - 王的文章是什么促使我检查日志状态代码。不幸的是,它并没有帮助我解决问题。 – 2010-01-06 15:21:20

+0

如果我试图预览Web部件,Fiddler显示URL为http:// sharepoint:15741/_layouts/WPPrevw.aspx?ID = 233。如果我尝试将Web部件添加到页面,我得到503(服务不可用)错误,然后甚至预览Web部件都会给我一个503,直到我重置IIS。 – 2010-01-06 15:22:57

+0

在“233”之后的URL结尾是否真的有一个斜杠符号?或者这只是StackOverflow?如果是,那么 - 你有答案 – naivists 2010-01-06 15:38:02