Results 1 to 2 of 2

Thread: <HeaederTemplate> of The Datalist

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2005
    Posts
    50

    <HeaederTemplate> of The Datalist

    Now I have a page like:

    Code:
    <script runat="Server">
       Private Payday As String
    
    Sub page_Load
       Payday = "Tommorrow"
    End Sub
    </script>
    
    <asp:DataList
        Runat="Server">
        <HeaderTemplate>
              '<%# String.Format("<h2>{0}</h2>", Payday) %>'
        </HeaderTemplate>
    </asp:Datalist>
    My problem is that the <HeaderTemplate> would not display the value in the variable as the header of the Datalist.

    But When I put in a static value like (<h2> Tommorrow <h2>) it is displayed as the header of the datalist.

    Can someone please tell me how to get around this please.
    Last edited by Apparrel; May 1st, 2006 at 05:32 AM.

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: <HeaederTemplate> of The Datalist

    You need
    Code:
    <%= String.Format("<h2>{0}</h2>", Payday) %>
    Notice = instead of # as hash is used in databinding.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width