2

i am new in sharepoint. I am developing a webpart where user is able to edit multiple records. Here this records get updated in bulk on button click. But there might be situation where user used time more than page timeout which will eventually result in timeout exception or page expired etc. So i do not want to happen this. How can i get timeout in mins or something like that so that i can warn user.

2

You can enclose the bulk operation code inside SPLongOperation. This operation has Begin and End methods.

protected void btnProvisionSites_Click(object sender, EventArgs e)
{
    //Long Operation Code
    using (SPLongOperation longOperation = new SPLongOperation(this.Page))
    {
        //Custom Messages on the Spinning Wheel Screen
        longOperation.LeadingHTML = "Provisioning Sites";
        longOperation.TrailingHTML = "Please wait while the sites are being provisioned.";

        //Start the long operation
        longOperation.Begin();

        //Your Long Operation Code Goes Here...
        // e.g. Site provisioning code

        //End the long operation
        string redirectURL = SPContext.Current.Web.Url + "/SitePages/SiteProvisioning.aspx";
        longOperation.End(redirectURL);
    }
}

http://nikpatel.net/2011/04/27/use-splongoperation-to-display-sharepoint-processing-page-for-lengthy-operations/

  • Thanks @Amal Hashim for your reply. If i use SPLongOperation to perform long tasks, what will be the timeout in minutes? – Ashish Dec 8 '14 at 5:16
  • There is no timeout scenarios for SPLongOperation. – Amal Hashim Dec 8 '14 at 13:01

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.