What control do I use (or do I not use a control at all...)

Okay so here's the story so far. I am making a blog to be incorporated into a website. Well, I'm doing the blog from scratch.

I'm using MySQL to source all the data via MySQL .NET/Connector. Now while developing the script, I used DataReader and Response.Write to show the blog topics. Now that it has come to put it under a design (I'm using a Master Page for that), I've hit the problem. Response.Write shows all the topics before any of the design elements could be incorporated. So that (more or less) is out of question. So next I looked into the data presentation controls. I looked up GridView, but it is a grid, not a summary of topics. I thought about FormView, but it shows only one topic per page, so that's out of question as well. Paging is important since there might be several topics started. Well, could somebody please suggest a control which can help me get these objectives. Maybe something which acts like Response.Write but does not show up at the top of the page but at the place where the content is supposed to appear. I did think about putting the entire code through Response.Write, but that would pretty much defeat the purpose of having Master Page and I'm willing to consider alternatives first.

 

Thanks a lot in advance.
 

0 shashank_hi 1/6/2007 6:28:59 PM
You shouldn't be using Response.Write() for page content like this.  Try using a DataList, if you don't like the grids.  A datalist allows for you to design how the layout of data will be, and then repeats that layout vertically for each record it is given.  This would give a similar effect as the list of Forum topics on this site.
---------------------------------------
MCP - Web Based Client Development .NET 2.0
0 ps2goat 1/7/2007 1:54:05 AM
I second that DataList suggestion. I'm using one for my test-blog and it's working well. I still have some things I want to add/adjust, like limiting the amount of records shown, and integrating inline links, but that shouldn't be too hard. So, yeah, a DataList is a good choice for a homegrown blog.
Dell 2400, XP SP2, IIS 5.1, VWD/SQL 2005 Express
0 mank1327 1/7/2007 2:22:39 AM

Thanks a lot. I used DataList and sourced the data via DataReader, DataTable and DataView and it worked wonderfully. Earlier I was thinking of putting everything into literals but this is way cleaner. As for paging, I did a bit of coding and that bit is also solved. Thanks a lot once again to both of you.

Cheers,

Shashank.

0 shashank_hi 1/7/2007 8:24:04 AM
Reply:

Thread closed