How to use a StaticItemTemplate?

Discussion in 'ASP .Net' started by Ilmar, Aug 13, 2004.

  1. Ilmar

    Ilmar Guest

    I've made an asp:menu control. Does anybody know how do I access the
    current menu item text from StaticItemTemplate?

    Any help would be apreciated.
    Ilmar, Aug 13, 2004
    #1
    1. Advertising

  2. "Ilmar" <> wrote in message
    news:...
    > I've made an asp:menu control. Does anybody know how do I access the
    > current menu item text from StaticItemTemplate?


    You should be able to find the asp:Menu control by following Parent pointers
    from a control within the StaticItemTemplate. Perhaps from there you can
    determine the current menu item.
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Aug 14, 2004
    #2
    1. Advertising

  3. Ilmar

    Ilmar Guest

    Thanks John,
    I finally solved this problem by the following code:


    <StaticItemTemplate>
    <asp:Label Runat=server>[<%# Eval("Text") %>]</asp:Label>
    </StaticItemTemplate>


    "John Saunders" <> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ ×
    ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: news:...
    > "Ilmar" <> wrote in message
    > news:...
    > > I've made an asp:menu control. Does anybody know how do I access the
    > > current menu item text from StaticItemTemplate?

    >
    > You should be able to find the asp:Menu control by following Parent

    pointers
    > from a control within the StaticItemTemplate. Perhaps from there you can
    > determine the current menu item.
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >
    Ilmar, Aug 15, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    5,040
  2. =?Utf-8?B?QUMgW01WUCBNQ01TXQ==?=

    Specifying style for subitems in the ASP Menu StaticItemTemplate

    =?Utf-8?B?QUMgW01WUCBNQ01TXQ==?=, Nov 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,038
    =?Utf-8?B?QUMgW01WUCBNQ01TXQ==?=
    Nov 15, 2006
  3. John123
    Replies:
    1
    Views:
    900
    John MJ Gorter
    Nov 6, 2007
  4. Andrew Jocelyn
    Replies:
    3
    Views:
    994
    Steven Cheng[MSFT]
    Jan 17, 2008
  5. Gery D. Dorazio
    Replies:
    0
    Views:
    292
    Gery D. Dorazio
    Nov 18, 2006
Loading...

Share This Page