ASPX templates
Version 3.x > ASPX templates > Finding a tree node via a Document Type field value View modes: 
User avatar
Member
Member
tcontosta-reflexdt - 11/6/2008 10:13:07 AM
   
Finding a tree node via a Document Type field value
I've added a FundID field to the Page (menu item) Document Type. I have a drop down of available funds that has the FundID as the Value property of the ListItem. So after a user selects the fund he wants, the page will autopostback and get the FundID and transfer the user to the correct CMS page.

My problem is that I don't know the "best practices" way of getting the URL for the Fund Page that has that FundID selected as it's FundID.

I can come up with the following SQL query to find the Alias Path:
SELECT ct.NodeAliasPath
FROM CONTENT_MenuItem cm
INNER JOIN CMS_Document cd ON cd.DocumentForeignKeyValue = cm.MenuItemID
INNER JOIN CMS_Tree ct ON ct.NodeID = cd.DocumentID
WHERE cm.FundID = @FundID

I can response redirect the user to the correct page by appending a ".aspx" onto the alias path.

I am wondering if there is another way to do this using any CMS Helper Classes.

Thanks in advance,
Tony

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/6/2008 12:26:26 PM
   
RE:Finding a tree node via a Document Type field value
Hello,

You can select any value from our database using our API. Please see our developer's guide for more information on the following link: http://www.kentico.com/docs/devguide/selecting_nodes.htm

I hope this helps.

Best Regards,
Boris Pocatko