Template variable in ASP.NET

Posted by williamrichards on Stack Overflow See other posts from Stack Overflow or by williamrichards
Published on 2010-05-23T17:18:27Z Indexed on 2010/05/23 17:20 UTC
Read the original article Hit count: 136

Filed under:

Hi,

I have to add a Page's variable into a ItemTemplate but dont know how.

For example:

<rad:RadMenuItem ID="f" runat="server" Text="Products">
   <ItemTemplate>
     <div class="pitem"><%= MyText %></div>
   </ItemTemplate>
</rad:RadMenuItem>

The MyText variable does exist in the context and has value but the text does not show up

Another question: How can I add MyText to the ASP.NET page like the following?

<asp:Button Text="<%=MyText%>" .../>

© Stack Overflow or respective owner

Related posts about ASP.NET