ASPX templates
Version 5.x > ASPX templates > Specify parameter to SQL query in document type View modes: 
User avatar
Member
Member
dmco - 7/24/2010 6:15:27 PM
   
Specify parameter to SQL query in document type
Hi

Unfortunately there doesn't seem to be any documentation around this either way.
I have a document type e.g. Recipe, which has a RecipeID.

I'm using the UserContributions module in order for users within the live site to be able to add recipes. However, I need to be able to display a list of RecipeIngredients in a dropdown list for each Recipe.

The query I need for the dropdown list in the Document Type configuration/user contribution form is:

SELECT IngredientID, IngredientName
FROM Ingredients
WHERE RecipeID=@RecipeID

Supplying the recipe ID from the document type being edited.

Is this possible? Or do I need to hack around with the UserContributions view to manually populate the dropdown list at the View level?


Thanks in advance

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 8/4/2010 2:23:09 PM
   
RE:Specify parameter to SQL query in document type
Hi,


you could develop a custom form control for the dropdownlist (Developing form controls). Then you can use the context values there (CMS Context class) and set up the deatasource for dropdownlist properly.


Best regards,
Helena Grulichova