Page 1 of 1

Slow product page updates

Posted: Thu Jul 31, 2008 9:53 am
by heinscott
Can someone help me with a bit of customization troubles?
I have added a bit of customization to my products page. One of them is to popup a "Please Select a valid size" message when the Add to Cart button is clicked when no option had been selected. To accomplish this, I just wrapped the whole OnCLick method in an If statement that would add a popup event to the button to run on pageload. Now, for some reason, this takes an unreasonable ammount of time. It's an extremely easy task, but takes more time that it takes to initially load the whole page!
Also, I have my product price tied to the selected option (and displaying the lowest kit price otherwise), so that the price shown in Orange changes when a different option is selected. This also takes extremely long on my server.
Now, on my development side (which is a vista machine, with SQL Express), everything runs much quicker... In fact, the AJAX working screen never even comes up. On my production server, however... Whoah! Look out!! Sometimes, 5 or 6 seconds.
Here is a good page to test this out on...

http://localhost:53336/AquaChek-7-Way-T ... P2938.aspx

Does anyone have any ideas for me? I'm at my wits end. I can't figure out a way of doing the check on the client side either, since these elements already have onchange or onclick event associated with them. Maybe I just don't have enough experience to come up with the best solution. That's what I'm betting on :)
Any help would be greatly appreciated!

Scott

Re: Slow product page updates

Posted: Fri Aug 01, 2008 7:18 am
by heinscott
Anybody have any ideas??

Re: Slow product page updates

Posted: Fri Aug 01, 2008 7:28 am
by mazhar
Please provide some valid URL this seems to be your localhost URL and doesn't work
http://localhost:53336/AquaChek-7-Way-T ... P2938.aspx

Re: Slow product page updates

Posted: Fri Aug 01, 2008 7:37 am
by heinscott
I'm SO sorry! My fault completely! I've been staring at this code for so long, it's caused me to lose my mind!!
Here is the URL for the production site. http://76.12.100.221/BioGuard-Polysheen-Blue-P2239.aspx
Thanks Mazhar!

Re: Slow product page updates

Posted: Fri Aug 01, 2008 9:21 am
by mazhar
You can try it with the client side script for example you can define a some javascript on the product control with a function like below

Code: Select all

<script type="text/ecmascript" language="javascript">
function OptionCheck()
{
    selectElement = document.getElementById("here will be the dropdown id etc");
    if(selectElement.value == "")
    {
        alert("Please select blah blah...");
        return false
    }
    return true;
}
</script>
and call the above function at the client click of the AddToBasket button as below

Code: Select all

<asp:LinkButton ID="AddToBasketButton" runat="server" SkinID="Button" Visible="true" OnClick="AddToBasketButton_Click" Text="Add to Basket" EnableViewState="false" ValidationGroup="AddToBasket" OnClientClick="return OptionCheck()"></asp:LinkButton>

Re: Slow product page updates

Posted: Fri Aug 01, 2008 9:39 am
by heinscott
Thank you so much Mazhar! I did not know that the OnClientClick existed. That will solve everything for me.
Thanks again!

Scott