MegaMenu and Literal

4 posts, 0 answers
  1. NTBuddy
    NTBuddy avatar
    4 posts
    Member since:
    Aug 2012

    Posted 22 Sep 2013 Link to this post

    I am using the demo of the mega menu and now that I have it built one of the sub-menus I want to have it filled via a custom list. I put a literal in and can't access the literal. I am sure I am missing something simple. The menu section is below. Thanks, John


    <telerik:RadMenuItem Text="Shows" PostBack="false">
                                <Items>
                                    <telerik:RadMenuItem CssClass="Shows" Width="640">
                                        <ItemTemplate>
                                            <div id="ShowsWrapper" class="Wrapper">
                                                <h3>Show Information</h3>
                                                <div class="ShowsLeft">
                                                    <asp:Literal runat="server" ID="LiteralCurrentShow"></asp:Literal>
                                                </div>
                                                <div class="ShowsRight">
                                                    <asp:Literal runat="server" ID="LiteralUpcomingShows"></asp:Literal>
                                                    <a class="moreLink" href="/Shows/">View all Shows</a>
                                                    </div>
                                            </div>
                                        </ItemTemplate>
                                    </telerik:RadMenuItem>
                                </Items>
                            </telerik:RadMenuItem>


  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 25 Sep 2013 Link to this post

    Hello John,

    Can you please clarify what you mean by saying that "I put a literal in and can't access the literal"? are you trying to find the literal through client-side or server-side? Can you also clarify the particular case?

    Regards,
    Kate
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. NTBuddy
    NTBuddy avatar
    4 posts
    Member since:
    Aug 2012

    Posted 25 Sep 2013 Link to this post

    In my TelerikRadItem in the ItemTemplate I have the following: 

    <asp:Literal runat="server" ID="LiteralCurrentShow"></asp:Literal>

    In my code behind where I want to inject the information it states it cannot see the Literal. I have this in the Page_Load event if it's not a post back to run. 

    The system is pulling from a database the newest show and displaying the link and title. I am basically trying to insert <a href="/xxxx/">yyyyy</a> into the literal being this information changes weekly.

    The second literal I am trying to insert three upcoming shows. The system is returning the right information but the code behind states it cannot see the literals. If I take the literals out of the Telerik component they are filled in with the correct information.
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 26 Sep 2013 Link to this post

    Hello John,

    Please refer to the following help article to get more information on how you can access a control that is inside an ItemTemplate - Accessing Controls Inside Templates.

    Regards,
    Kate
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top