views:

1129

answers:

3

I want to create something similiar to a facebook wall on my social site. I want to store the posts in an sql database and that should be rather simple. What I am looking for is a good way to display the posts? I guess I don't even really know where to start, as I can only think of using a loop to display asp:textboxes. Which obviously is not correct.

I want there to be multiple posts displayed on the page: which should include: the user who posted, the text posted, the date posted, and if I want to get crazy...a means of deleting/editing the post.

I really have no idea of how to implement this concept, so any ideas would help greatly. Thank you.

A: 

ASP.NET gives you lots of ways to do this. A Repeater, DataGrid, GridView are the first that come to mind. If you'd rather use ASP.NET MVC, there's always the good old foreach loop.

Additionally, check out ListView too.

swilliams
+1  A: 

go ahead with jquery, use a lot of ajax. for the mark up, use a repeater control with all clean html mark up (instead of server side controls which would generate a lot of unnecessary mark up quickly creating performance issues)

only populate x number of items on initial load, and then using jquery pull data as required based on user action. you can serve this data via json, decode json on client side using jquery and perform a loop which converts this json into appropriate html and injects it into the correct html element

should be simple ;-)

Raj
+1  A: 

To get started, view this article from asp.net on the Repeater control, or this great article.

The Repeater control lets you databind to a list of objects, and then define one template for how that object should be displayed. Then, ASP.NET will handle showing it as many times as necessary. You can write the code-behind for dealing with delete and edit as if there were only one instance on the page.

JoshJordan
excellent thank you, that makes a lot of sense. I will post back if I get it working.
Please do. Also, please mark this or another post as an answer to help others :)
JoshJordan