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

编辑器/阅读器

开发平台:

C#

  1. <%@ Page language="c#" AutoEventWireup="true" %>
  2. <%@ Import Namespace="DotNetTextBox" %>
  3. <html>
  4. <head>
  5. <meta http-equiv="pragma" content="no-cache" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  7. <base target="_self" />
  8. <style type="text/css">
  9. body,a,table{font-size:12px;font-family:宋体,Verdana,Arial}
  10. </style>
  11. <script runat="server" language="C#">
  12. private void Page_Load(object sender, System.EventArgs e)
  13. {
  14.     if (Request.Cookies["languages"] != null)
  15.     {
  16.         ResourceManager.SiteLanguageKey = Request.Cookies["languages"].Value;
  17.     }
  18.     else
  19.     {
  20.         ResourceManager.SiteLanguageKey = HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"].ToLower().Split(',')[0];
  21.     }
  22. }
  23. </script>
  24. <script type="text/javascript">
  25. var userAgent = navigator.userAgent.toLowerCase();
  26. var is_ie = (userAgent.indexOf('msie') != -1);
  27. var arr=new Array;
  28. function insertLink()
  29. {   
  30.    if(document.getElementById("link").value!="")
  31.     {
  32.     arr[0]=document.getElementById("link").value;
  33.     arr[1]=document.getElementById("target").value;
  34.     }
  35.     if(is_ie)
  36.     {
  37.     window.returnValue = arr;
  38.     }
  39.     else
  40.     {
  41.     if(document.getElementById("insert").value!='<%=ResourceManager.GetString("edit")%>')
  42.     {
  43.     if(window.opener.GetImgLink()!="")
  44.     {
  45.     arr[2]=window.opener.GetImgLink();
  46.     }
  47.     window.opener.inserObject(null,'link',arr);
  48.     }
  49.     else
  50.     {
  51.     window.opener.inserObject(null,'editlink',arr);
  52.     }
  53.     }
  54.     
  55.     window.close();
  56. }
  57. var sTitle='<%=ResourceManager.GetString("addlink")%>';
  58. if(is_ie)
  59. {
  60. if (dialogArguments!=null)
  61. sTitle='<%=ResourceManager.GetString("editlink")%>';
  62. }
  63. else
  64. {
  65. arr=window.opener.GetLink();
  66. if(arr[0]!=null)
  67. {
  68. sTitle='<%=ResourceManager.GetString("editlink")%>';
  69. }
  70. window.focus();
  71. }
  72. document.write("<TITLE>" + sTitle + "</TITLE>");
  73. </script>
  74. </head>
  75. <body leftmargin="5" topmargin="0">
  76. <form runat=server>
  77. <br />
  78. <fieldset><br />
  79. <select id="linktype" onchange="javascript:link.value=this.value">
  80.         <option selected="selected"  value="http://">http</option>
  81.         <option value="https://">https</option>
  82.         <option value="ftp://">ftp</option>
  83.         <option value="file://">file</option>
  84.         <option value="gopher://">gopher</option>
  85.         <option value="mailto:">mailto</option>
  86.         <option value="news:">news</option>
  87.         <option value="telnet:">telnet</option>       
  88.         <option value="wais:">wais</option>
  89.         <option value="">other</option>
  90.     </select>
  91.     <input id="link" style="width: 205px" onload="this.focus()" value="http://" type="text" />
  92.     <select id="target">
  93.                                     <option selected="selected" value=""><%=ResourceManager.GetString("openlinktype")%></option>
  94.                                     <option value="_blank"><%=ResourceManager.GetString("_blank")%></option>
  95.                                     <option value="_self"><%=ResourceManager.GetString("_self")%></option>
  96.                                     <option value="_parent"><%=ResourceManager.GetString("_parent")%></option>
  97.                                     <option value="_top"><%=ResourceManager.GetString("_top")%></option>
  98.                                     
  99.                                 </select><br />
  100.     <input id="insert" onclick="insertLink();parent.popMenu2.hide();" type="button" value='<%=ResourceManager.GetString("insert")%>'/>
  101.     <input onclick="window.close();" type="button" value='<%=ResourceManager.GetString("close")%>'/></fieldset>
  102. </form>
  103. <script language=javascript>
  104. if(is_ie)
  105. {
  106. document.body.bgColor="ButtonFace";
  107. if (dialogArguments!=null)
  108. {
  109. document.getElementById("link").value=dialogArguments[0];
  110. if(dialogArguments[1]!="")
  111. {
  112. document.getElementById("target").value=dialogArguments[1];
  113. }
  114. document.getElementById("insert").value='<%=ResourceManager.GetString("edit")%>';
  115. }
  116. }
  117. else
  118. {
  119. document.body.bgColor="#E0E0E0";
  120. if(arr[0]!=null)
  121. {
  122. document.getElementById("link").value=arr[0];
  123. if(arr[1]!="")
  124. {
  125. document.getElementById("target").value=arr[1];
  126. }
  127. document.getElementById("insert").value='<%=ResourceManager.GetString("edit")%>';
  128. }
  129. }
  130. </script>
  131. </body>
  132. </html>