Click here to Skip to main content
15,902,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to bind multiple controls in repeater control.

I need to show the comment entered in a TextBox and the Username and DateTime of post in labels....

I need the textbox on top and then in the second row the two labels.

How do i do this??
Posted

1 solution

Below is an example using a repeater with some bound elements.
ASP.NET
<div class="section">
    <asp:repeater id="Repeater1" runat="server" datasourceid="LinkDataSource" xmlns:asp="#unknown">
        <HeaderTemplate>
            <div class="section-caption">
                <%= Caption %>
            </div>
            <div class="section-content">
                <ul>
        </HeaderTemplate>
        <itemtemplate>
            <li><a href="<%# Eval(" url=") %>">
                <%# Eval("LinkName") %>
            </a>
                <p>
                    <%# Eval("Comment") %>
                </p>
            </li>
        </itemtemplate>
        <footertemplate>
            </footertemplate></ul> </div>
        
    </asp:repeater>
</div>
<asp:objectdatasource id="LinkDataSource" runat="server" selectmethod="GetLinks" xmlns:asp="#unknown">
    TypeName="LinkService">
    <SelectParameters>
        <asp:parameter defaultvalue="MAIN" name="Context" type="String" />
    </SelectParameters>
</asp:objectdatasource>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900