More in this section

Forums / Developing with Sitefinity / Cast Category Selected from Insert/Edit Modes

Cast Category Selected from Insert/Edit Modes

2 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    16 Feb 2006
    09 Dec 2008
    Link to this post

    Could you help me to cast the selected Category from Insert/Edit Modes of GC Modules to use codebehind. I have tried many times using Recursive methods that work fine for other items like Titles or Author but nothing for cast this Category or Tags items added to my post.

    <sfCtg:CategoriesField id="Category" runat="server" />

    DropDownList CatProj = (DropDownList)loc_Proj.FindControlRecursive(this.Page, "Category"); // NO CASTING

    other how cast the tags added?


  2. Ivan
    Ivan avatar
    478 posts
    16 Jun 2015
    11 Dec 2008
    Link to this post
    Hello Pierre,

    as the markup suggests the control is of type CategoriesField and not DropDownList. So the correct code would look like this:
    CategoriesField CatProj = (CategoriesField)loc_Proj.FindControlRecursive(this.Page, "Category"); 

    I hope you will find this information helpful. Let us know if there is anything else we can do for you.

    Sincerely yours,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered