Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

i am working on a custom web part where i have a few dropdowns in the tool pane so it take a while to load the dropdownlist and i have total three dropdownlist... i need to show the Loading message when user click on those dropdownlist in the tool pane property window

anybody have done similar to this?

share|improve this question
add comment

2 Answers

The Client OM has features in place to interact with the Notification messages and Status bar. Check out the SP.UI namespace.

Here is the documentation on MSDN with an example: http://msdn.microsoft.com/en-us/library/ee658473.aspx

Here are some other Client OM related examples on my blog for the Status bar and ModalDialog box. http://www.mikeoryszak.com/sharepoint/use-the-status-bar-to-display-active-workflows

share|improve this answer
add comment

I think you will need loading message only if you use Ajax or Callback in your web part. Otherwise, the page itself will reload and hence no need of message.

If you use Ajax Updatepanel , you can use Sys.WebForms.PageRequestManager beginRequest Event to show loading image or message in a div. When request ends i.e. when you get response, you can use Sys.WebForms.PageRequestManager endRequest Event to hide the div. Below is the sample code you can use in aspx page:

//For Ajax calls
<asp:ScriptManager ID="scriptManager" runat="server" />       

//write this script at the botom of <form> tag
<script type="text/javascript">
//Hook the event handlers
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

function BeginRequestHandler(sender, args) 
{
   ShowDiv();
}
function EndRequestHandler(sender, args)
{
  HideDiv();          
}

Use the script at the end of page ,otherwise you may get error "Sys.WebForms.PageRequestManager is null or not an object"

The other option is to use Updateprogress control along with updatepanel.However, I prefer client side code for this scenario.

share|improve this answer
    
where do you put the above code? and what show/hide code looks like? –  Abu Hamzah Oct 19 '11 at 18:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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