This is a migrated thread and some comments may be shown as answers.

MegaMenu and Literal

3 Answers 23 Views
Menu
This is a migrated thread and some comments may be shown as answers.
NTBuddy
Top achievements
Rank 1
NTBuddy asked on 23 Sep 2013, 12:22 AM

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>


3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 25 Sep 2013, 11:49 AM
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.
0
NTBuddy
Top achievements
Rank 1
answered on 25 Sep 2013, 12:20 PM
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.
0
Kate
Telerik team
answered on 26 Sep 2013, 03:10 PM
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.
Tags
Menu
Asked by
NTBuddy
Top achievements
Rank 1
Answers by
Kate
Telerik team
NTBuddy
Top achievements
Rank 1
Share this question
or