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

编辑器/阅读器

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" Inherits="DotNetTextBox.CodeConverter" validateRequest="false" %>
  2. <%@ Import Namespace="DotNetTextBox" %>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
  6. <title><%=ResourceManager.GetString("codehighlighter")%></title>
  7. <base target="_self" />
  8. <link href="stylesheet.css" rel="stylesheet" type="text/css" />
  9. <script language=javascript>
  10. var userAgent = navigator.userAgent.toLowerCase();
  11. var is_ie = (userAgent.indexOf('msie') != -1);
  12. function inserteditor()
  13. {
  14. var codstyle = "<div style='BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee'>";
  15. if(is_ie)
  16. {
  17. window.parent.returnValue=codstyle+document.getElementById("htmlcontent").value+"</div>";
  18. }
  19. else
  20. {
  21. window.opener.plugin_execommand(codstyle+document.getElementById("htmlcontent").value+"</div>");
  22. }
  23. window.parent.close();
  24. }
  25. </script>
  26. </head>
  27. <body topmargin="10">
  28. <form id="code" runat="server">
  29. <table border="0" cellpadding="0"cellspacing="0" width="100%">
  30. <tr>
  31. <td align="center">
  32. <div align="center">
  33. <table border=1 style="border-style:dashed ;"  bordercolor="#cccccc" >
  34. <tr>
  35. <td style="width: 86px; height: 32px" align="right">
  36.                             <%=ResourceManager.GetString("codetype")%>:</td>
  37. <td style="width: 487px; height: 32px">
  38.                             &nbsp;<asp:DropDownList ID="ddlLanguages" runat="server">
  39.                             </asp:DropDownList>&nbsp;
  40.                             <asp:CheckBox ID="chkIncludeLineNumbers" runat="server" />&nbsp;<asp:RadioButton
  41.                                 ID="rdoUsePreTag" runat="server" GroupName="whitespaceoptions"/>&nbsp;<asp:RadioButton ID="rdoConvertWhitespace" runat="server"
  42.                                     GroupName="whitespaceoptions" Checked="True" /></td>
  43. </tr>
  44.                     <tr>
  45.                         <td align="right" style="width: 86px; height: 32px">
  46.                             <%=ResourceManager.GetString("codestyle")%>:</td>
  47.                         <td style="width: 487px">
  48.                             &nbsp;<asp:DropDownList ID="ddlStyleType" runat="server">
  49.                                 <asp:ListItem Selected="True" Value="Inline Styles">Inline Styles</asp:ListItem>
  50.                                 <asp:ListItem Value="Inline Tags">Inline Tags</asp:ListItem>
  51.                             </asp:DropDownList></td>
  52.                     </tr>
  53. <tr>
  54. <td style="width: 86px; height: 300px;" align="right">
  55.                             <%=ResourceManager.GetString("codecontent")%>:<br />
  56.                             [<%=ResourceManager.GetString("pastecode")%>]</td>
  57. <td align="center"><asp:TextBox Runat="server" ID="txtCodeInput" TextMode="MultiLine" Rows="10" Columns="80" Height="310px" Width="100%" BorderColor="Gray" BorderStyle="Dashed" BorderWidth="1px"/></td>
  58. </tr>
  59. <tr>
  60. <td style="height: 30px;" align="center" colspan="2">
  61.                             <asp:Button ID="btnCodeHtmlify" runat="server"/>
  62.                             <input type=Button ID="close" value="<%=ResourceManager.GetString("close2")%>"  OnClick="window.close()"/></td>
  63. </tr>
  64. </table>
  65. </div>
  66.             <asp:HiddenField ID="htmlcontent" runat="server" />
  67. </td>
  68. <td></td>
  69. </tr>
  70. <tr>
  71. <td class="FooterBar" colspan="2" align="center"></TD>
  72. </tr>
  73. </table>
  74. </form>
  75. </body>
  76. <script language=javascript>
  77. var userAgent = navigator.userAgent.toLowerCase();
  78. var is_ie = (userAgent.indexOf('msie') != -1);
  79. if(is_ie)
  80. {
  81. document.body.bgColor="ButtonFace";
  82. }
  83. else
  84. {
  85. document.body.bgColor="#E0E0E0";
  86. }
  87. </script>
  88. </html>