Anonymous users and aspx pages inside the _layouts folder

I ran smack into an issue that was looking to be a serious problem yesterday. One of my development projects (SharePoint) is an anonymous access public-facing website. This site using built-in SharePoint web services and the download.aspx page in the _layouts directory to facilitate lookup of related documents and provide download capability. The issue? Anonymous users can’t use any of the application pages in the _layouts folder.

Lots of head scratching and some creative Google searches led me to the “DotNetIdeas” blog, specifically this post. It details how the _layouts, _controltemplates, and _vti_bin directories are affected by allowing access to anonymous users. I recommend you go read their post, but the key excerpt is this:
<blockquote>Anonymous users can never load pages inheriting from Microsoft.SharePoint.WebContorls.LayoutsPageBase</blockquote>The answer to my issue is to create my own download.aspx page (not overwriting the original) without inheriting from this class. I’d still be hunting whatever setting was keeping anonymous users from these pages if not for that helpful post though.

Read More >

Fastest XML Editor/Viewer

I use Visual Studio every day for just about all of my development tasks. However, I attempted to open a large xml file (> 20 megs) and Visual studio spiked up to 1.5 gigs of memory consumption and I couldn’t do anything… My old standby notepad++ (great editor!) also hung on opening the file. A quick search yielded First Object’s XML Editor. Worked great. Super fast.

Read More >

Occasional SPException from GetListItemDataWithCallback

Wrote a new field control today (SharePoint) that queried a specific list in another site collection based on the value of a field from the current list item. This worked great each time I’d test it out and add some additional functionality. When I finished the control, I did a little harder testing by hitting the refresh button in my browser over and over again. Randomly, my control wouldn’t render. Other times it would be fine. What’s up with that?

If you Google it enough, you’ll find that this message generally appears when your CAML is malformed. Well - I used an XmlWriter to build my CAML query (that way my inserted value from the item would be escaped properly for XML), so surely my CAML must be fine if it’s working most times??? Right??? Nope. The XmlWriter by default puts in a processing instruction on the first line:

<xml version=”1.0” encoding=”UTF-8” ?>

Remove this first line and the field controls render each time without error. The specific error I was receiving was:

Microsoft.SharePoint.SPException was caught
Message=”Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))”
at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback)

Read More >

subscribe via RSS