Get access to Dropdown list generated by options and variant

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Dylan
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Wed Jun 23, 2010 6:39 am

Get access to Dropdown list generated by options and variant

Post by Dylan » Thu Aug 19, 2010 4:49 am

I have created a option “Width” for my product which generates a dropdown list within a PlaceHolder control on the product page. I want to get access to this dropdown list control in BuyProductDialog.ascx.cs how can I do this ?

I want to get the length of the dropdown list and loop round the list of items.

Can I use method PageHelper.RecursiveFindControl(phOptions, what attribute do I need to pass by value here)


Thanks

Dylan

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Get access to Dropdown list generated by options and variant

Post by mazhar » Thu Aug 19, 2010 5:07 am

Have a look at ProductHelper.BuildProductOptons method. This method is used to generate/populate the product options. Secondly I don't think so RecursiveFindControl could be used here because these controls are dynamic so control id will not be known. You can try to do one trick where when creating these dynamic options in BuildProductOptoins method you can also inject some of your hidden HTML where you can put the corresponding clientid of each dropdown. Then once you can access information about each dropdown list using clientid information and RecursiveFindContorl method.

Post Reply