Using Custom programming within SharePoint always takes time to execute and create a issue with impatient client. Client always think that we have not done a good job with coding so it will take a long time. Some time if some long operation is going on like creation of site or something like that then 3rd person thinks like process is hang up.
So what we need to do is that do some indication screen like “In progress”.
And the exciting news is SharePoint is providing built in function for “Operation in Progress” spinning wheel and object is called as “SPLongOperation”.
You can use this object in various places like creating a custom SharePoint site, setting up properties, creating a Project in Different server, calling a web services, updating/adding multiple items in SharePoint…. Etc.
Check the following snippet which is used in webpart.
void btnSubmit_Click(object sender, EventArgs e)
{
SPLongOperation longoperation = new SPLongOperation(this.Page)
longoperation.LeadingHTML = "Leading HTML shows here";
longoperation.TrailingHTML = "Trailing HTML will be displayed here";
longoperation.Begin();
// Code which will take time…
longoperation.End(strURL);
}
So what we need to do is that do some indication screen like “In progress”.
And the exciting news is SharePoint is providing built in function for “Operation in Progress” spinning wheel and object is called as “SPLongOperation”.
You can use this object in various places like creating a custom SharePoint site, setting up properties, creating a Project in Different server, calling a web services, updating/adding multiple items in SharePoint…. Etc.
Check the following snippet which is used in webpart.
void btnSubmit_Click(object sender, EventArgs e)
{
SPLongOperation longoperation = new SPLongOperation(this.Page)
longoperation.LeadingHTML = "Leading HTML shows here";
longoperation.TrailingHTML = "Trailing HTML will be displayed here";
longoperation.Begin();
// Code which will take time…
longoperation.End(strURL);
}
Comments
Post a Comment