Please excuse my ignorance -- I am not sure if this is even correct practice, let alone possible to achieve in SharePoint. My self-taught knowledge of SharePoint development was all learned by observing what a predecessor in my position had done.

Basically, I have a "registration app" in SharePoint. Initially, this simple application used BDC (BCS?) to connect to an external SQL Server database to add registrations for classes and perform lookups using CAML queries and external lists.

The use of this application exceeded what it was initially designed for and now the database tables hold about 50k records. The problem now is that these external list lookups take forever. Just submitting a form on the page takes upwards of a minute, which I assume is due to either ineffiencies in the BDC or perhaps my implementation of it.

To resolve the slowness, I opted to create a web API to handle registrations and db lookups (which take less than a second when run on the database directly).

I am attempting to use asynchronous methods in code-behind on a custom page layout. The async calls will post and receive JSON objects between the page and the web API. The async method is hooked up to a button's click event handler. SharePoint immediately errors out when the form is submitted.

Are asynchronous calls initiated from code-behind pages disallowed by SharePoint? Must the calls be performed in JavaScript instead of code-behind? When researching this issue, I found someone saying the "async" page directive needs to be added to the page, but this might generate a parsing error in SP? Any help or suggestions would be greatly appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.