Changeset 1199

Show
Ignore:
Timestamp:
2007-12-13 17:49:25 (2 years ago)
Author:
fredck
Message:

Completed the samples for the .NET Framework 2.0.

Location:
FCKeditor.Net/trunk/_samples/aspx/2.0
Files:
6 added
1 removed
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor.Net/trunk/_samples/aspx/2.0/sample01.aspx

    r1167 r1199  
    1 <%@ Page ValidateRequest="false" Language="C#" AutoEventWireup="false" %> 
    2 <%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %> 
    3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
     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"> 
    45<%-- 
    56 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 
     
    2425 * Sample page. 
    2526--%> 
    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 ) 
    3034        { 
    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>"; 
    3740        } 
     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 
    3854</script> 
    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> 
    6899</html>