default.aspx
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:1k
源码类别:

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" ValidateRequest=false %>
  2. <%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
  3. <script runat="server">
  4. protected void Page_Load(Object Src, EventArgs E) {
  5. //if (!IsPostBack) {
  6. FreeTextBox FreeTextBox1 = new FreeTextBox();
  7. FreeTextBox1.ID = "FreeTextBox1";
  8. FreeTextBoxPlaceHolder.Controls.Add(FreeTextBox1);
  9. //}
  10. }
  11. protected void SaveButton_Click(Object Src, EventArgs E) {
  12. FreeTextBox FreeTextBox1 = FreeTextBoxPlaceHolder.FindControl("FreeTextBox1") as FreeTextBox;
  13. Output.Text = FreeTextBox1.Text;
  14. }
  15. </script>
  16. <html>
  17. <head>
  18. <title>Custom DropDownList values</title>
  19. <script>
  20. </script>
  21. </head>
  22. <body>
  23.     <form id="Form1" runat="server">
  24.     
  25.      <h2>Programmatically added FreeTextBox</h2>
  26.     
  27.      <div>
  28. <asp:PlaceHolder id="FreeTextBoxPlaceHolder" runat="server" />
  29. <asp:Button id="SaveButton" Text="Save" onclick="SaveButton_Click" runat="server" />
  30. </div>
  31. <div>
  32. <asp:Literal id="Output" runat="server" />
  33. </div>
  34. </form>
  35. </body>
  36. </html>