Hey,
I would like for a user to click an 'Add to Cart' Button, a message appears 'Adding Item to Cart ...', and then the message changes to 'Item added to Cart' when finished. I have under the AddToCart_Click event changing the label to 'Adding to Shopping Cart ...' then the code to actually add the item to the shopping cart and then changing the label to 'Item added to Cart.' However, only the last label is seen (Item added to Cart). Any suggestions on how to do this? Should I use 2 Update Panels? Or, how do I tell it to display both labels?
Thanks,
Beej
Hi
I am not sure about this, but please check Update progress or timer control from Ajax.Net. It may help you.
regards
Anuraj.P
I would suggest using the UpdateProgress component from the AjaxControlToolkit. What you specify in the ProgressTemplate tag of the UpdateProgress control will be visible during the callback, in your case the message 'Adding item to cart...'
SplashMan:
Hey,
I would like for a user to click an 'Add to Cart' Button, a message appears 'Adding Item to Cart ...', and then the message changes to 'Item added to Cart' when finished. I have under the AddToCart_Click event changing the label to 'Adding to Shopping Cart ...' then the code to actually add the item to the shopping cart and then changing the label to 'Item added to Cart.' However, only the last label is seen (Item added to Cart). Any suggestions on how to do this? Should I use 2 Update Panels? Or, how do I tell it to display both labels?
Thanks,
Beej
hi,
Subscribe to add_beginRequest and add_endRequest events of the Sys.WebForms.PageRequestManager like so:
<script type="text/javascript">
//<![CDATA[
var prm = Sys.WebForms.PageRequestManager.getInstance();
var displayLabel= $get("displayText");
prm.add_beginRequest(function(){
displayLabel.innerHTML = "Adding Item To Cart ...";
});
prm.add_endRequest(function(){
displayLabel.innerHTML = "Item added to Cart ...";
});
//]]>
</script>
hth
No comments:
Post a Comment