| 26 | | <script runat="server" language="C#"> |
| 27 | | // This sample doesnt use a code behind file to avoid the user to have to compile |
| 28 | | // the page to run it. |
| 29 | | protected override void OnLoad(EventArgs e) |
| | 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 ) |
| 31 | | // Automatically calculates the editor base path based on the _samples directory. |
| 32 | | // This is usefull only for these samples. A real application should use something like this: |
| 33 | | // FCKeditor1.BasePath = '/FCKeditor/' ; // '/FCKeditor/' is the default value. |
| 34 | | string sPath = Request.Url.AbsolutePath ; |
| 35 | | int iIndex = sPath.LastIndexOf( "_samples") ; |
| 36 | | FCKeditor1.BasePath = sPath.Remove( iIndex, sPath.Length - iIndex ) ; |
| | 35 | if ( Page.IsPostBack ) |
| | 36 | return; |
| | 37 | |
| | 38 | // Set the startup editor value. |
| | 39 | FCKeditor1.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=\"http://www.fckeditor.net/\">FCKeditor</a>.</p>"; |
| | 41 | |
| | 42 | protected void BtnSubmit_Click( object sender, EventArgs e ) |
| | 43 | { |
| | 44 | // For sample purposes, print the editor value at the bottom of the |
| | 45 | // page. Note that we are encoding the value, so it will be printed as |
| | 46 | // is, intead of rendering it. |
| | 47 | LblPostedData.Text = HttpUtility.HtmlEncode( FCKeditor1.Value ); |
| | 48 | |
| | 49 | // Make the posted data block visible. |
| | 50 | PostedDataBlock.Visible = true; |
| | 51 | PostedAlertBlock.Visible = true; |
| | 52 | } |
| | 53 | |
| 39 | | <html> |
| 40 | | <head> |
| 41 | | <title>FCKeditor - Sample</title> |
| 42 | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 43 | | <meta name="robots" content="noindex, nofollow"> |
| 44 | | <link href="../sample.css" rel="stylesheet" type="text/css" /> |
| 45 | | <script type="text/javascript"> |
| 46 | | |
| 47 | | function FCKeditor_OnComplete( editorInstance ) |
| 48 | | { |
| 49 | | window.status = editorInstance.Description ; |
| 50 | | } |
| 51 | | |
| 52 | | </script> |
| 53 | | </head> |
| 54 | | <body> |
| 55 | | <h1>FCKeditor - ASP.Net - Sample 1</h1> |
| 56 | | This sample displays a normal HTML form with an FCKeditor with full features |
| 57 | | enabled. |
| 58 | | <br> |
| 59 | | No code behind is used so you don't need to compile the ASPX pages to make it |
| 60 | | work. All other samples use code behind. |
| 61 | | <hr> |
| 62 | | <form action="sampleposteddata.aspx" method="post" target="_blank"> |
| 63 | | <FCKeditorV2:FCKeditor id="FCKeditor1" runat="server" value='This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.'></FCKeditorV2:FCKeditor> |
| 64 | | <br> |
| 65 | | <input type="submit" value="Submit"> |
| 66 | | </form> |
| 67 | | </body> |
| | 55 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | 56 | <head> |
| | 57 | <title>FCKeditor - Sample</title> |
| | 58 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | 59 | <meta name="robots" content="noindex, nofollow" /> |
| | 60 | <link href="../sample.css" rel="stylesheet" type="text/css" /> |
| | 61 | <style type="text/css"> |
| | 62 | pre { background-color: #f5f5f5; padding: 5px; border: #d3d3d3 1px solid; } |
| | 63 | </style> |
| | 64 | </head> |
| | 65 | <body> |
| | 66 | <form runat="server"> |
| | 67 | <h1> |
| | 68 | FCKeditor - ASP.NET - Sample 1 |
| | 69 | </h1> |
| | 70 | <p> |
| | 71 | This sample displays a normal HTML form with an FCKeditor with full features enabled. |
| | 72 | </p> |
| | 73 | <p> |
| | 74 | No code behind is used so you don't need to compile the ASPX pages to make it work. |
| | 75 | All other samples use code behind. |
| | 76 | </p> |
| | 77 | <p id="PostedAlertBlock" style="color: Red" runat="server" visible="false"> |
| | 78 | The posted data has been printed at the bottom of the page. |
| | 79 | </p> |
| | 80 | <p> |
| | 81 | <!--- |
| | 82 | Here we have the FCKeditor component tag. It has been created |
| | 83 | by dragging the FCKeditor icon from the toolbar to the page, in design mode. |
| | 84 | ---> |
| | 85 | <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server"> |
| | 86 | </FCKeditorV2:FCKeditor> |
| | 87 | </p> |
| | 88 | <p> |
| | 89 | <asp:Button ID="BtnSubmit" runat="server" OnClick="BtnSubmit_Click" Text="Submit" /> |
| | 90 | </p> |
| | 91 | </form> |
| | 92 | <div id="PostedDataBlock" runat="server" visible="false"> |
| | 93 | <p> |
| | 94 | Posted data: |
| | 95 | </p> |
| | 96 | <pre><asp:Label ID="LblPostedData" runat="server"></asp:Label></pre> |
| | 97 | </div> |
| | 98 | </body> |