Improve Custom Control Communications


https://forum.kartris.com/Topic3280.aspx
Print Topic | Close Window

By Tiggywiggler - Sat 23 Aug 2014
Currently Kartris has a very powerful feature known as the 'Custom Control' concept which allows the developer to design a custom control which anyone can then plug into their Kartris deployment. The end user then refers to this custom control from within thei product setup and the control will be displayed when the product page is viewed. This is very good, however the current standard interface does not allow the custom control to have any knowledge about the product it is attached to and so cannot be used for multiple similar products that have variable rates.

Consider if you will the example given in the Kartris documentation at this page http://userguide.kartris.com/Default.aspx?headID=312 in heading 16.2.1 where we have a blinds and curtain shop. Here you can calculate the area of a curtain by width and height which is great, however, as far as I can tell the custom control has no knowledge of what curtain or blind this is and as such will not be able to calculate the rate at which the product is charged. For example let's assume I have a material that is £15 per square meter. I can tell Kartris what the square meterage is from my custom control but I cannot say what the price is as I do not know what curtain or blind I am measuring.

There is a way in which the custom control can read back up the control hierarchi to read the value of ProductId from ProductVersions.ascx but this is not inline with Microsoft programming guidelines.

I think that it would be correct for the custom control interface (KartrisClasses.CustomProductControl) to include an initialise method that would be populated with common information such as product Id, price (as this may be a way for the end customer to set a rate multiplier etc.), description etc.

I know that you may not agree but I would like to hear your opinion on this either way please.

Thank you very much.

EDIT: You can read the Product ID directly from the Querystring and I do not know if this is what you expected developers to do with this control or not. Like I said previously the main objective of this post is to get your opinion please.