I recently began writing an AJAX web part for use in SharePoint and I am having a strange error. It seems that EnsurePanelFix() is causing the web part to throw a 401 error; in the log, both 401.2 and 401.3 errors are showing up right around the same time. I made some changes to EnsurePanelFix() after doing a bit of research on here and some other sites, and it is currently as follows:
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);
}
Watching the security log, I see that the failures are logged as such:
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
There are multiple failure audits with the only differing data between them being the operation ID.
Can anyone see any reason that I would be having authentication or file permission problems given that everything works fine without this piece of code? Thanks.
EDIT: I'm pretty sure that it has something to do with the ACLs, but I'm not exactly sure where to look for what resources may be causing the issue.