I need to create a function which is like an "Add friend" function. first of all, as a logged in user, I am able to search for a list of other users in the website. after which i can click a hyperlink and it brings me to a page where i can type a message and send it to my friend through email. That message will also show up at my friend's homepage in a textbox accompanied by an Accept and a Reject button for friend to accept or deny friend request. the question is: how do i make the control (the texbox with the accept and reject button) such that it's a "template" and that it will show up at the homepage according to the number of friend request i have. say if i have 3 request, so i'll have 3 of the template at my homepage. attached is the UI. for example i have 1 rows of data inserted, 3 of the UI will appear. how do i do that?
Create user control and use the fact that public properties are accessible during control declaration. For example if your control is called and registered on page as "AcceptUserControl" and prefix "my" then you declare it like this: <my:AcceptUserControl UserToAccept="USER_ID".... UserToAccept will be stored in your custom control public property and in page load you can bind control proper data from database. Such control you can use on website unlimited number of times each with different usertoaccept. You can also add it to page using repeater or code begind.