install.aspx.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Web;
  6. using System.Web.UI;
  7. using System.Web.UI.WebControls;
  8. using CB.Data;
  9. using CB.Entity;
  10. namespace CB.TVUCenter.Web
  11. {
  12. public partial class install : System.Web.UI.Page
  13. {
  14. protected StringBuilder TvQuestion = new StringBuilder();
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17. if (!IsPostBack)
  18. {
  19. InitData();
  20. }
  21. }
  22. /// <summary>
  23. /// 生成常见问题
  24. /// </summary>
  25. private void InitData()
  26. {
  27. int Record = 0;
  28. List<TopicInfo> lists = TopicService.ToPaging("207", 10, 1, out Record, "Tid ASC").ToList();
  29. if (lists == null) return;
  30. for (int i = 0; i < lists.Count; i++)
  31. {
  32. string question = @"<li " + ((i > 3) ? "style='display:none;'" : "") + @">
  33. <strong class='faq-question'>" + (i+1).ToString()+"、"+lists[i].Title + @"</strong>
  34. <div class='faq-answer' " + (i == 0 ? "style='display:block;'" : "") + @">
  35. <p>" + lists[i].Context + "</p></div></li>";
  36. TvQuestion.Append(question);
  37. }
  38. }
  39. }
  40. }