Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Please somebody help me here. I have a project that deals with questions and answers, see how it goes:

When a user post a question, people on the site answers the question meaning a question will have multiple answers and here is my challenges. There are list of questions on my page and when a user click on a particular question, the application directs the user to another page and brings out all the answers corresponding to the question they clicked but my challenge is how to create HTML table data(
) or table row at runtime so that I can put different answers in different HTML
or table row because i am selecting all answers for a single question. I want to display the answers in a Table Row
or Table Data
which means i will need to create a or
for each answer when the page loads the answers for a question.

Your respond will be highly appreciated.
Posted
Comments
fjdiewornncalwe 23-Nov-10 14:14pm    
Is there a requirement that requires you to use an html table? It may be better to do some research on using a DataGridView or a control of that nature to display it if you can.

Hi,
according to your posted scenario I believe you don't need dynamic table to show multiple answers. Simple repeater will do your job with more simply. If you are not much used to with asp.net repeater control these articles will help
http://www.netrostar.com/Tutorials-91-ASP.NET%20Tutorial.%20How%20to%20use%20Repeater[^]
http://articles.sitepoint.com/article/asp-net-repeater-control[^]
http://www.w3schools.com/ASPNET/aspnet_repeater.asp[^]
http://www.asp101.com/articles/lee/multiupdate/default.asp[^]

Hope this will help
 
Share this answer
 
Hi Olammy

You use below code, create the Html Tag on run time..


XML
Response.Write("<div><font size='2' face='Tahoma'><B>" +
                                   mydata + "</B></font></div>");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900