Welcome Guest Search | Active Topics | Sign In | Register

Disabling a button during a callback Options
Mark Rae
Posted: Tuesday, November 18, 2008 10:26:52 PM
Rank: Advanced Member
Groups: Member

Joined: 11/13/2008
Posts: 43
Hi,

Is there a technique for disabling a button inside a CallbackPanel while a callback is happening and, maybe, modifying the button's text at the same time? This would be used to prevent a user from clicking a button twice e.g. when placing an order or saving a record. E.g.

Code: HTML/ASPX
<CallbackPanel>
    <asp:Button ID="MyButton" runat="server" Text="Checkout" OnClick="MyButton_Click" />
</CallbackPanel>


When the user clicks the button, I would like to:

1) disable it to prevent a user clicking it again
2) set its Text property to "Processing..."
3) run the MyButton_Click code as a callback
4) set its Text property to "Complete"

Thanks,

Mark
eo_support
Posted: Wednesday, November 19, 2008 6:22:37 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

There are a few options for you to do it. One is to set the CallbackPanel's AutoDisableContents to true and then set its LoadingHTML/LoadingPanelID/LoadingDialogID property. Another option is to handle the CallbackPanel's ClientSideBeforeExecute event to do whatever you'd like to do with JavaScript. Here are two related samples:

http://www.essentialobjects.com/Demo/Default.aspx?path=Callback\_i0\_i3
http://www.essentialobjects.com/Demo/Default.aspx?path=Callback\_i0\_i4

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.