2010-01-04 33 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