demo_skin_cs.aspx
上传用户:lanchensha
上传日期:2022-02-27
资源大小:7530k
文件大小:3k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <%@Page Language="C#" ValidateRequest="false" ContentType="text/html"%>
  2. <%@Register TagPrefix="dntb" Namespace="DotNetTextBox" Assembly="DotNetTextBox"%>
  3. <script runat="server" language="C#">
  4. private void Page_Load(object sender, System.EventArgs e)
  5. {
  6. if (!IsPostBack)
  7. {
  8. WebEditor1.Text = "<a href=http://www.aspxcn.com.cn><img src='system_dntb/skin/default/img/logo.gif' alt='DotNet中华网版权所有' width=260 height=60 border=0></a>";
  9. }
  10. }
  11. private void Button1_OnClick(object sender, System.EventArgs e)
  12. {
  13. label1.Text = "<hr><b>以下是DotNetTextBox控件提交的内容</b>:<br>"+WebEditor1.Text;
  14. }
  15. private void Button2_OnClick(object sender, System.EventArgs e)
  16. {
  17. WebEditor1.Text="";
  18. }
  19. private void ChangedMenu(object sender, System.EventArgs e)
  20. {
  21.     WebEditor1.MenuConfig = menu.SelectedItem.Value;
  22. }
  23.     
  24. private void ChangedSkin(object sender, System.EventArgs e)
  25. {
  26. WebEditor1.Skin=skin.SelectedItem.Value;
  27. }
  28. </script>
  29. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  30. <html xmlns="http://www.w3.org/1999/xhtml" >
  31. <head>
  32. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  33. <title>演示:个性化应用实例(C#)</title>
  34. <style type="text/css">
  35. <!--
  36. body {
  37. font-size: 9pt;
  38. }
  39. hr {
  40. border: dotted #AFAFAF;
  41. }
  42. input {
  43. font-size: 9pt;
  44. border: 1px ridge #999999;
  45. background-color: #FFFFFF;
  46. cursor:pointer;
  47. }
  48. TABLE {
  49. FONT: 9pt 宋体,Verdana,Arial
  50. }
  51. -->
  52. </style>
  53. </head>
  54. <body>
  55.     <table width="560" align=center>
  56.         <tr>
  57.             <td valign="top" style="width: 556px">
  58.                 <fieldset>
  59.                     <legend>演示说明</legend>&nbsp; &nbsp; 本例子演示了通过下拉选择框变换DotNetTextBox控件的个性化设置,包括控件的皮肤及菜单功能!</fieldset>
  60.             </td>
  61.         </tr>
  62.     </table>
  63.     <br />
  64. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  65.   <tr>
  66.     <td align=center><form id="Form1" runat="server">
  67. [控件皮肤选择]:<asp:dropdownlist id="skin" AutoPostBack="true" OnSelectedIndexChanged="ChangedSkin" runat="server">
  68. <asp:listitem value="skin/default/">标准风格</asp:listitem>
  69. <asp:listitem value="skin/xp/">WINXP风格</asp:listitem>
  70. </asp:dropdownlist>
  71.         &nbsp;&nbsp;
  72. [菜单功能选择]:<asp:dropdownlist id="menu" AutoPostBack="true" OnSelectedIndexChanged="ChangedMenu" runat="server">
  73. <asp:listitem value="default.config">默认</asp:listitem>
  74. <asp:listitem value="custom1.config">自定义1</asp:listitem>
  75. <asp:listitem value="custom2.config">自定义2</asp:listitem>
  76. <asp:listitem value="all.config">全功能</asp:listitem>
  77. </asp:dropdownlist>
  78.         <p align="center"><DNTB:WebEditor id="WebEditor1" runat="server"></DNTB:WebEditor> </p>
  79.         <p align="center"> 
  80.           <asp:Button id="Button1" CssClass="input" OnClick="Button1_OnClick" runat="server" Text="提交内容"></asp:Button>
  81.           <asp:Button id="Button2" CssClass="input" OnClick="Button2_OnClick" runat="server" Text="清空内容"></asp:Button>
  82.         </p>
  83.       </form></td>
  84.   </tr>
  85. </table>
  86. <asp:label runat="server" ID="label1"></asp:label>
  87. </body>
  88. </html>