Cliff,
There sure is. Let's look at One Page Checkout\Checkout.aspx for example. The state DropDownList looks like this:
Code:
<anthem:DropDownList ID="ShippinglstState" runat="server" AutoCallBack="true" TextDuringCallBack="Please Wait..." TabIndex="1110"></anthem:DropDownList>
All of the Anthem controls that can make a callback have a property called TextDuringCallBack. As you can see in the source, TextDuringCallBack="Please wait...", but as you also noticed, this text does not seem to appear anywhere. The reason is that the DropDownList control does not have any natural text to set during the callback. For example, if this had been a Button, then the text of the button would change to "Please wait..." during the callback.
When Anthem can not find a natural text value to change it looks for an associated <label> control instead. So one fix in this case is to associate a real <label> with the DropDownList. For example change,
Code:
<td class="formlabel">State, Zip:</td>
to this
Code:
<td class="formlabel">
<asp:Label runat="server" AssociatedControlId="ShippinglstState">State, Zip:</asp:Label>
</td>
After making this change the state label "State, Zip:" will change to "Please wait..." during the callback. Note that you can put the associated label anywhere on the page, it does not need to be the actual label.
As you know Gmail does something a little different. Every time you do something in gmail that causes a callback, gmail will display "Please wait..." (or something similar) in a colored box at a fixed
location of the viewport (top right I think). You can do something similar with Anthem controls using pre- and post- callback functions. For example put this <div> on your page:
Code:
<div id="wait" style="display:none">Please wait...</div>
Then define these two js functions:
Code:
function Before() {
document.getElementById('wait').style.display = 'block';
}
function After() {
document.getElementById('wait').style.display = 'none';
}
Now there are two ways to invoke these functions. If you want specific controls to use them, use PreCallBackFunction and PostCallBackFunction like this:
Code:
<anthem:DropDownList ID="ShippinglstState" runat="server" AutoCallBack="true" TextDuringCallBack="Please Wait..." TabIndex="1110" PreCallBackFunction="Before" PostCallBackFunction="After"></anthem:DropDownList>
If you want all callbacks to use them, add this to your page:
Code:
function Anthem_PreCallBack() { Before(); }
function Anthem_PostCallBack() { After(); }
These Before and After functions are a little simple minded. If you make multiple callbacks (e.g. change the country and the zip very quickly), then the first After will hide the <div> even though the slower callback is still running. A more intelligent Before/After would use some kind of counter and maybe a timer to keep track. You can disable most controls during callback so you don't get two clicks. For example,
Code:
<anthem:Button runat="server" EnabledDuringCallBack="false">Click Me!</anthem:Button>
And you can combine EnabledDuringCallBack with TextDuringCallBack:
Code:
<anthem:Button runat="server" EnabledDuringCallBack="false" TextDuringCallBack="Running...">Click Me!</anthem:Button>
And finally, ImageButton has a similar property called ImageDuringCallBack. I'm sure you can guess how it works.