<%@ page autoeventwireup="false" inherits="WebExam.Web.addnews, App_Web_wetjxh0p" title="编辑新闻" language="vb" masterpagefile="~/Page.master" validaterequest="false" %>


<%@ MasterType VirtualPath="~/Page.master" %>
<asp:Content ID="head" runat="server" ContentPlaceHolderID="ContentHead">

    <script type="text/javascript" src="../../richedit/fckeditor.js"></script>

</asp:Content>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="mainCopy">
    <table align="center" border="0" style="width: 90%">
        <tr>
            <td colspan="2">
                <p align="center">
                    <font face="宋体" size="5">编辑新闻</font>
                </p>
            </td>
        </tr>
        <tr>
            <td>
                <font face="宋体">标题</font>
            </td>
            <td>
                <asp:TextBox ID="newstitle" MaxLength="450" runat="server" Style="width: 90%"></asp:TextBox><asp:RequiredFieldValidator
                    ID="RequiredFieldValidator1" runat="server" ErrorMessage="请输入标题" ControlToValidate="newstitle"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <font face="宋体">内容</font>
            </td>
            <td>

                <script type="text/javascript">
<!--
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
var sBasePath = "/richedit/" ;

var oFCKeditor = new FCKeditor( 'FCKeditor1' );
oFCKeditor.BasePath	= sBasePath ;
oFCKeditor.Height = 380 ;
// Set the custom configurations file path (in this way the original file is mantained).
oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + '_samples/html/sample06.config.js' ;

// Let's use a custom toolbar for this sample.
oFCKeditor.ToolbarSet	= 'mytool' ;

oFCKeditor.Value		= '<%= getText() %>' ;
oFCKeditor.Create() ;


function FCKeditor_OnComplete( editorInstance )
{   
    //init(parent.tests);allTags[0].tagObj.onclick() ;
    
}
function getEditorValue(){
	     //得到编辑器的值
	        var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
	        if (oEditor.EditMode == FCK_EDITMODE_WYSIWYG)
            {return oEditor.GetXHTML(true);}
            else
            {var t=oEditor.GetHTML(false);return t;}
	     }

function getValue(){
   document.getElementById("<%= newscontent.ClientId() %>").value=getEditorValue();


}
//-->
                </script>

                <asp:TextBox ID="newscontent" runat="server" Style="display: none"></asp:TextBox><asp:RequiredFieldValidator
                    ID="RequiredFieldValidator2" runat="server" ErrorMessage="请输入内容" ControlToValidate="newscontent"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <p align="center">
                    <asp:Button ID="Btnadd" runat="server" Text="确定" OnClientClick="return getValue();" /></p>
            </td>
        </tr>
    </table>
</asp:Content>
