none
datalist itemTamplet prblem RRS feed

  • Question

  • hellow evrybody

    i have this code:

    <asp:DataList ID="DataList1" runat="server">
        
    <ItemTemplate>

            <asp:Label ID="lblID" runat="server" Text = '<%# Eval("id") %>'></asp:Label>

        </ItemTemplate>

    </asp:DataList>

    that represent label inside itemtamplet for datalist.

    and i have this code in C# inside script tag:

    <script runat="server">

    protected void Page_Load(object sender, EventArgs e)

    {

        int _contentID;

    }

    </script>



    my quistion is : how can i place the content of text property of the "lblID" in  _contentID variable, while i cant say: _contentID = lblID.Text, because it is insid the datalist itemTamplet.

    please help me

    and i'm sorry for my poor english.

    • Edited by a_e_s Tuesday, March 10, 2009 8:25 AM title
    Tuesday, March 10, 2009 8:07 AM

Answers