RadMenu Vs Itemtamplate

3 posts, 0 answers
  1. Jose Luiz Borges
    Jose Luiz Borges avatar
    10 posts
    Member since:
    Jun 2009

    Posted 10 Aug 2009 Link to this post

    Hi,

    I need help...

    this is my code in aspx:

            <telerik:RadMenu ID="RadMenu1" runat="server">
                <Items>
                    <telerik:RadMenuItem>
                        <ItemTemplate>
                            <b>Skin:</b>
                            <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Hay" ShowChooser="True">
                            </telerik:RadSkinManager>
                        </ItemTemplate>
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadMenu>

    i need take the value into in RadSkinManager1.Skin...

    I try this code into CS;
            Session["skinid"] = ((RadSkinManager)RadMenu1.FindControl("RadSkinManager1")).Skin;

    Object reference not set to an instance of an object.


    But dont't work, if i run CTRL+F5 in my screen show...

    
    
    Line 13: 		{
    Line 14: 			
    Line 15: Session["skinid"] = ((RadSkinManager)RadMenu1.FindControl("RadSkinManager1")).Skin; Line 16: }


    My question is ?

    How get de value (Skin) the component RadSkinManager, but this component into in ITEMTAMPLATE for radmenu...

    ps. sorry dont write very well my english, but i realy need this code my friendly's

    tanks and best regards

    José Luiz Brazil
  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 13 Aug 2009 Link to this post

    Hello Jose Luiz Borges,

    Here's your modified code snippet that works as expected

    ASPX:
    <telerik:RadMenu ID="RadMenu1" runat="server"
            <Items> 
                <telerik:RadMenuItem Value="templateHolder"
                    <ItemTemplate> 
                        <b>Skin:</b> 
                        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Hay" ShowChooser="True"
                        </telerik:RadSkinManager> 
                    </ItemTemplate> 
                </telerik:RadMenuItem> 
            </Items> 
        </telerik:RadMenu> 

            Session["skinid"] = ((RadSkinManager)RadMenu1.FindItemByValue("templateHolder").FindControl("RadSkinManager1")).Skin; 
        } 


    Best wishes,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Jose Luiz Borges
    Jose Luiz Borges avatar
    10 posts
    Member since:
    Jun 2009

    Posted 19 Aug 2009 Link to this post

    Hi,

    tanks for reply...

    yes it's work now...
Back to Top