fork download
  1. protected void Page_Load(object sender,EventArgs e) {
  2. for(int i=0;i<ThreadList.Length;i++) {
  3. Label label=new Label();
  4. label.ID="Label_"+i.ToString()+"name";
  5. label.Text="名前:";
  6. form1.Controls.Add(label);
  7.  
  8. TextBox textboxname=new TextBox();
  9. textboxname.ID="TextBox_"+i.ToString()+"name";
  10. form1.Controls.Add(textboxname);
  11.  
  12. TextBox textboxpost=new TextBox();
  13. textboxpost.ID="TextBox_"+i.ToString()+"post";
  14. textboxpost.Height=100;
  15. textboxpost.Width=500;
  16. textboxpost.TextMode=TextBoxMode.MultiLine;
  17. form1.Controls.Add(textboxpost);
  18.  
  19. Button button=new Button();
  20. button.ID="Button_"+i.ToString()+"post";
  21. button.Text="書き込む";
  22. button.OnClientClick="CI_Thread[" + i.ToString() + "].Button_POST_Click";
  23. form1.Controls.Add(button);
  24. }
  25. }
  26.  
  27. //////////////////////////////////////////////////////////////
  28. ///////////////////以下.aspxのソースコード////////////////////
  29. //////////////////////////////////////////////////////////////
  30.  
  31. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BBS.aspx.cs" Inherits="kadai_number.BBS" %>
  32.  
  33. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w...content-available-to-author-only...3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  34.  
  35. <html xmlns="http://w...content-available-to-author-only...3.org/1999/xhtml" >
  36. <head runat="server">
  37. <title>無題のページ</title>
  38. <link href="StyleSheet1.css" rel="stylesheet" type="text/css" />
  39. </head>
  40. <body>
  41. <form id="form1" runat="server">
  42.  
  43. /////////////////////ここにユーザーコントロールが欲しい(けどできない!)/////////////////////////
  44.  
  45. </form>
  46. </body>
  47. </html>
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,16): error CS0116: A namespace can only contain types and namespace declarations
prog.cs(31,1): error CS8025: Parsing error
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty