1 | <%@ Page Language="C#" %> |
---|
2 | |
---|
3 | <%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %> |
---|
4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
5 | <%-- |
---|
6 | * FCKeditor - The text editor for Internet - http://www.fckeditor.net |
---|
7 | * Copyright (C) 2003-2008 Frederico Caldeira Knabben |
---|
8 | * |
---|
9 | * == BEGIN LICENSE == |
---|
10 | * |
---|
11 | * Licensed under the terms of any of the following licenses at your |
---|
12 | * choice: |
---|
13 | * |
---|
14 | * - GNU General Public License Version 2 or later (the "GPL") |
---|
15 | * http://www.gnu.org/licenses/gpl.html |
---|
16 | * |
---|
17 | * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
---|
18 | * http://www.gnu.org/licenses/lgpl.html |
---|
19 | * |
---|
20 | * - Mozilla Public License Version 1.1 or later (the "MPL") |
---|
21 | * http://www.mozilla.org/MPL/MPL-1.1.html |
---|
22 | * |
---|
23 | * == END LICENSE == |
---|
24 | * |
---|
25 | * Sample page. |
---|
26 | --%> |
---|
27 | <script runat="server"> |
---|
28 | |
---|
29 | // In this page, we are placing all server side code inline to the page, to |
---|
30 | // avoid having to compile the page in your web site to run it. |
---|
31 | // Of course it would work in the same way with Code Behind. |
---|
32 | |
---|
33 | protected void Page_Load( object sender, EventArgs e ) |
---|
34 | { |
---|
35 | if ( Page.IsPostBack ) |
---|
36 | return; |
---|
37 | |
---|
38 | // Set the startup editor value. |
---|
39 | s1.Value = "<div style='padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; width: 422px; padding-top: 0px; position: relative; height: 271px; background-color: red'>" + |
---|
40 | "<div style='padding-right: 0px; padding-left: 0px; left: 1px; padding-bottom: 0px; margin: 0px; width: 420px; padding-top: 0px; position: relative; top: 1px; height: 269px; background-color: green'>[]" + |
---|
41 | "</div></div>"; |
---|
42 | |
---|
43 | s2.Value = "<div style='border-right: #a5a27c 5px solid; border-top: #a5a27c 5px solid; border-left: #a5a27c 5px solid; width: 411px; border-bottom: #a5a27c 5px solid; position: relative; height: 261px'>"+ |
---|
44 | "<div style='border-right: #000000 2px solid; border-top: #000000 2px solid; left: 1px; border-left: #000000 2px solid; width: 405px; border-bottom: #000000 2px solid; position: relative; top: 1px; height: 255px'>[]"+ |
---|
45 | "</div></div>"; |
---|
46 | |
---|
47 | FCKeditor1.Value = s1.Value.Replace("[]", "<br/> Incorrect rendering (red box is too tall)"); |
---|
48 | div1.InnerHtml = s1.Value.Replace("[]", "<br/> Correct rendering"); |
---|
49 | } |
---|
50 | |
---|
51 | </script> |
---|
52 | |
---|
53 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
54 | <head> |
---|
55 | <title>FCKeditor - Sample</title> |
---|
56 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
57 | <meta name="robots" content="noindex, nofollow" /> |
---|
58 | <link href="../sample.css" rel="stylesheet" type="text/css" /> |
---|
59 | <style type="text/css"> |
---|
60 | pre { background-color: #f5f5f5; padding: 5px; border: #d3d3d3 1px solid; } |
---|
61 | body |
---|
62 | { |
---|
63 | background-color: #ffffff; |
---|
64 | padding: 5px 5px 5px 5px; |
---|
65 | margin: 0px; |
---|
66 | } |
---|
67 | </style> |
---|
68 | <script language="javascript" type="text/javascript"> |
---|
69 | function button(example) |
---|
70 | { |
---|
71 | var s; |
---|
72 | var editor = FCKeditorAPI.GetInstance('FCKeditor1') ; |
---|
73 | if (example==1) { |
---|
74 | s = document.getElementById("s1"); |
---|
75 | editor.SetHTML(s.value.replace("[]", "<br/> Incorrect rendering (red box is too tall)")); |
---|
76 | } else { |
---|
77 | s = document.getElementById("s2"); |
---|
78 | editor.SetHTML(s.value.replace("[]", "<br/> Incorrect rendering (black box is one pixel two wide and not tall enough, tan box is too tall)")); |
---|
79 | } |
---|
80 | document.getElementById("div1").innerHTML = s.value.replace("[]", "<br/> Correct rendering"); |
---|
81 | } |
---|
82 | |
---|
83 | </script> |
---|
84 | </head> |
---|
85 | <body> |
---|
86 | <form runat="server"> |
---|
87 | <h1> |
---|
88 | FCKeditor - ASP.NET - Sample 1 |
---|
89 | </h1> |
---|
90 | <p id="editor1"> |
---|
91 | <!--- |
---|
92 | Here we have the FCKeditor component tag. It has been created |
---|
93 | by dragging the FCKeditor icon from the toolbar to the page, in design mode. |
---|
94 | ---> |
---|
95 | <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath ="~/FCKEditor/" ImageBrowserURL="~/FCKEditor/" LinkBrowserURL="~/FCKEditor/" Height="450px" Width="430px" > |
---|
96 | </FCKeditorV2:FCKeditor> |
---|
97 | |
---|
98 | |
---|
99 | <input type="button" value="Example 1" onclick="button(1);" /> |
---|
100 | <input type="button" value="Example 2" onclick="button(2);" /> |
---|
101 | </p> |
---|
102 | <div id="div1" runat="server" style="position:absolute; left:437px; top:184px;"> |
---|
103 | </div> |
---|
104 | <input id='s1' runat="server" type='hidden' /> |
---|
105 | <input id='s2' runat="server" type='hidden' /> |
---|
106 | </form> |
---|
107 | </body> |
---|
108 | </html> |
---|