Chris Ara
12-05-2006, 11:06 AM
Hey all !!!
I'm trying make a simple message board. What I need is a control that repeats it contents over and over again for each message in the board. Such a a repeating message box for each message. The control of would need be dynamic so each time loads it can resize and what not. Is there any such control avaible in ASP .NET.
Thanks Chris
MikeJ
12-05-2006, 11:22 AM
Sounds like you would just loop through each element returned in an array, and then display the contents of that particular row in your database. There should be no "control" needed, outside of connecting to the database.
wayneph
12-05-2006, 01:03 PM
Actually it sounds like a DataList or Repeater would be what you're looking for. In them you can set up Item Templates, and bind them to your Database objects.
A DataList generally creates a table, while using a repeater allows you to create any type of HTML content you want.
Chris Ara
01-09-2007, 11:05 AM
lol I wish I had seen the REPEATER CONTROL in the toolbox earlier. Ok I learned how to use this control to connect to a database , but is there anyway I can use a repeater control of data list control that is bound to a text file ?
wayneph
01-09-2007, 12:29 PM
yes. you can bind to anything that is enumerable. Just read your TextFile into an Array or something like that, and then you can bind to the Array.
If you're using .NET 2.0, I'd create an Object that represents what's in your text and then use the List(Of YourType) Generic Collection.