views:

42

answers:

1

Good Morning All,

I have loaded over 1,300 blurbs into my client's database with table schema of BlurbID, Seq, Content, Keywords. A separate database table will contain vote details (voteID, BlurbID, Seq, VoteDate). His intent is to have a blurb website that serves up humorous quotes. Users must vote for the first blurb before being allowed to see the next one, and so forth.

The client will modify the blurb table as needed to re-sequence the blurbs. He wants the blurbs displayed on content pages in the website according to the value of the SEQ field in the Blurbs table. Thus, the entry with SEQ=1 will be the first Blurb displayed on the site etc. Users will be required to vote using a radiobuttonlist for each blurb before being allowed to see the next blurb.

Question: Is it advisable to use one content page (default.aspx) to serve up the blurbs? If I do that, how do I structure a stored procedure to select the blurbs according to the SEQ field in the blurb table? Conversely, do I create content pages for each of the 1,300 blurbs? If I use one content page, what would the TSQL look like to iterate through the blurbs according to the SEQ field after a vote is cast for each blurb? Pseudo code would be: if radiobuttonlist.value >0 then select blurb id, seq, blurbcontent, keywords from blurbs where seq = current seq +1

Finally, for SEO purposes, should I output the keywords database field to a hidden field on the content page?

If you have written this type of site before, I would greatly appreciate your insight and guidance.

Thanks, Sid

+1  A: 

Learn asp.net ;) Seriously - especially the ASP.NET routing added some time ago, and while you are at it, learn MVC.

  • There is no sense to even have more than one view on the data. It is all the same.

  • Years ago, those who did not know made something like "/default.aspx/id=1

  • Years ago, those who DID read the documentation wrote something like "/content.ashx/112

  • Today everyone should use URL routing and write something like /sometitle.html for everything, and use the routing mechanism to route that call to a program module (page, view, whatever) that generates the html.

I suggest pulling the title from the database (or use the first x words) so you have some textual reference, not jut an ID.

Now, database

What do you mean with "how do I structure a stored procedure to". This is similar to "how do I structure a pizza delivery service to deliver pizza tonno". The stored procedure sturecture should depend on your coding guidelines, not on what data you retrieve- this is for the code part in the structure. And that will depend a lot on your needs, which obviously are - given from the site design.

Why do you think you even need a stored procedure here? ;)

TomTom
I've done some reading on URL routing in 3.5SP1 and understand that this would be the way to tackle my project. Given that the first blurb would be displayed on default.aspx, how would I structure my route so that blurb with seq=2 is loaded after radiobuttonlist has a selected value?
SidC