Click here to Skip to main content
15,893,368 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on a my ASP.NET Semester Project with MS SQL SERVer 2012, and i am developing an Social application like twitter.
I have made the UI and database on which user post his notification on and i when user preview his all notification all the notification messages displays in a list style with delete and update button. I have made this static like preview only recent 10 notification.

But i want that when user preview his notification page. The notification messages and their count is get from database and dynamically crate and show this on text boxes/label at run time, doesn't depend how many notification it is My be 100 or 10. It will create text boxes an many as number of notification per user.
Posted

1 solution

Hi,
Use asp .net RepeaterControl and put your labels and textboxes inside repeater.You can assign the dataset to RepeaterControl.
Eg:
XML
<asp:Repeater ID="rptCustomers" runat="server">
        <ItemTemplate>
            <tr>
                <td>
                    <asp:Label ID="lblCustomerId" runat="server" Text='<%# Eval("CustomerId") %>' />
                </td>
                <td>
                    <asp:Label ID="lblContactName" runat="server" Text='<%# Eval("ContactName") %>' />
                </td>
                <td>
                    <asp:Label ID="lblCompanyName" runat="server" Text='<%# Eval("CompanyName") %>' />
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
 
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