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

编辑器/阅读器

开发平台:

C#

  1. <%@ Page language="c#" AutoEventWireup="true"  Inherits="DotNetTextBox.PageCode" %>
  2. <%@ Import Namespace="DotNetTextBox" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" >
  5. <head>
  6. <title><%=ResourceManager.GetString("findfile")%></title>
  7. <meta http-equiv="pragma" content="no-cache" />
  8. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  9. <base target="_self" />
  10. <link href="stylesheet.css" rel="stylesheet" type="text/css" />
  11. </head>
  12. <script language="JavaScript" type="text/javascript">
  13. var userAgent = navigator.userAgent.toLowerCase();
  14. var is_ie = (userAgent.indexOf('msie') != -1);
  15. if(is_ie)
  16. {
  17. var oSelection;
  18. oSelection = dialogArguments.document.body.createTextRange();
  19. }
  20. function searchtype(){
  21. var retval = 0;
  22. var matchcase = 0;
  23. var matchword = 0;
  24. if (document.frmSearch.blnMatchCase.checked) matchcase = 4;
  25. if (document.frmSearch.blnMatchWord.checked) matchword = 2;
  26. retval = matchcase + matchword;
  27. return(retval);
  28. }
  29. function checkInput(){
  30. if (document.frmSearch.strSearch.value.length < 1) {
  31. alert('<%=ResourceManager.GetString("pleaseinput")%>');
  32. return false;
  33. } else {
  34. return true;
  35. }
  36. }
  37. oSelection.expand("textedit");
  38. oSelection.collapse();
  39. oSelection.select();
  40. function findtext(){
  41. if (checkInput()) {
  42. var searchval = document.frmSearch.strSearch.value;
  43. oSelection.collapse(false);
  44. if (oSelection.findText(searchval, 1000000000, searchtype())) {
  45. oSelection.select();
  46. } else {
  47. var startfromtop = confirm('<%=ResourceManager.GetString("findfinal")%>');
  48. if (startfromtop) {
  49. oSelection.expand("textedit");
  50. oSelection.collapse();
  51. oSelection.select();
  52. findtext();
  53. }
  54. }
  55. }
  56. }
  57. window.focus();
  58. </script>
  59. <body>
  60. <form id="frmSearch" runat="server"  class="alertbgc">
  61. <div  class="alertbgc">
  62. <TABLE CELLSPACING="0" cellpadding="5" border="0"  class="alertbgc">
  63. <TR><TD VALIGN="top" align="left">
  64. <label for="strSearch"><%=ResourceManager.GetString("findname")%></label><br>
  65. <INPUT TYPE=TEXT SIZE=40 NAME=strSearch id="strSearch" style="width : 200px;"><br>
  66. <INPUT TYPE=Checkbox SIZE=40 NAME=blnMatchCase ID="blnMatchCase"><label for="blnMatchCase"><%=ResourceManager.GetString("casesensitive")%></label><div id='matchword'><INPUT TYPE=Checkbox SIZE=40 NAME=blnMatchWord ID="blnMatchWord"><label for="blnMatchWord"><%=ResourceManager.GetString("wholeword")%></label></div>
  67. </td>
  68. <td rowspan="2" valign="top">
  69. <input type=button style="width:80px;margin-top:15px" name="btnFind" onClick="findtext();" value='<%=ResourceManager.GetString("findnext")%>'><br />
  70. <input type=button style="width:80px;margin-top:5px" name="btnCancel" onClick="window.close();" value='<%=ResourceManager.GetString("close")%>'><br>
  71. </td>
  72. </tr>
  73. </table>
  74. </div>
  75. </form>
  76. </body>
  77. <script language=javascript>
  78. if(is_ie)
  79. {
  80. document.body.bgColor="ButtonFace";
  81. }
  82. else
  83. {
  84. document.body.bgColor="#E0E0E0";
  85. }
  86. </script>
  87. </html>