Posted By

scholli on 12/04/10


Tagged

sharepoint sp2010


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

cybermax
Priestd09


Show Status Bar through C# Code


 / Published in: C#
 

  1. using Microsoft.SharePoint.WebControls;
  2.  
  3. //....
  4.  
  5. //Add Page Status bar
  6. SPPageStatusSetter statusSetter = new SPPageStatusSetter();
  7. statusSetter.AddStatus("Aktiviert", "Daten wurden erfolgreich ├╝bertragen.", SPPageStatusColor.Green);
  8. this.Controls.Add(statusSetter);
  9.  
  10. //Set JavaScript function to remove Status Bar after 5 seconds
  11. string jsFunction = @"<script type='text/javascript'>" +
  12. "window.setTimeout(function(){ SP.UI.Status.removeAllStatus(true); }, 5000);" +
  13. "</script>";
  14. Page.RegisterClientScriptBlock("RemoveStatusBar", jsFunction);

Report this snippet  

You need to login to post a comment.