Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sharepoint SPLongOperation

Posted on 2014-10-07
1
Medium Priority
?
434 Views
Last Modified: 2014-10-13
I have a page with a dropdown, once you choose a value a report runs and comes back in a Gridview.  The data takes about 11 or 12 seconds to run and I want to put up some kind of wait, so I found and tried to use SPLongOperation.  The code below shoes the wait page, but then returns to the page without the data.  I think this is because I do not understand what the last line is doing.  Why does the End method of SPLongOperation require a redirect ?  I do not want to redirect, I want to stay, after the data is retrieved.

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
      {
      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...
        Button1.Visible = true;

        //End the long operation
        string redirectURL = SPContext.Current.Web.Url + "/SitePages/Report.aspx";
        longOperation.End(redirectURL, SPRedirectFlags.Trusted, HttpContext.Current, "");
        }
      }
0
Comment
Question by:Demosthenes
1 Comment
 
LVL 8

Accepted Solution

by:
Jayaraja Jayaraman earned 2000 total points
ID: 40377292
splong operation are intended to spin and bring back with refershed data which is nothing but it will do a post back. in literal words in your case atleast you shouldnt be using splongrun , you should try jquery spservices for wait and show browsing wheel.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question