2012-08-17 121 views
0

我正在使用asp.net web表單第三方WYSIWYG編輯器以及它與爲WYSIWYG編輯器

<%@ Register TagPrefix="editor" Assembly="WYSIWYGEditor" Namespace="InnovaStudio" %> 

這裏需要註冊字段驗證爲代碼在CS文件返回

<editor:WYSIWYGEditor runat="server" ID="txtDesc" /> 

這是設置爲wysiwyg

 //'*************************************************** 
    //' SETTING EDITOR DIMENSION (WIDTH x HEIGHT) 
    //'*************************************************** 

    //'*************************************************** 
    //' SETTING EDITING MODE 
    //' 
    //' Possible values: 
    //'  - "HTMLBody" (default) 
    //'  - "XHTMLBody" 
    //'  - "HTML" 
    //'  - "XHTML" 
    //'*************************************************** 

    txtDesc.EditMode = "XHTMLBody"; 



    //'*************************************************** 
    //' SETTING EDITOR DIMENSION (WIDTH x HEIGHT) 
    //'*************************************************** 

    txtDesc.EditorWidth = 750.ToString(); //'You can also use %, for example: oEditSummary.EditorWidth = "100%" 
    txtDesc.EditorHeight = 450.ToString(); 

    //'*************************************************** 
    //' SHOWING DISABLED BUTTONS 
    //'*************************************************** 

    txtDesc.btnPrint = true; 
    txtDesc.btnPasteText = true; 
    txtDesc.btnFlash = true; 
    txtDesc.btnMedia = true; 
    txtDesc.btnLTR = true; 
    txtDesc.btnRTL = true; 
    txtDesc.btnSpellCheck = true; 
    txtDesc.btnStrikethrough = true; 
    txtDesc.btnSuperscript = true; 
    txtDesc.btnSubscript = true; 
    txtDesc.btnClearAll = true; 
    txtDesc.btnStyles = true; //'Show "Styles/Style Selection" button 

    //'*************************************************** 
    //' SPECIFY onSave EVENT COMMAND 
    //'*************************************************** 

    //oEditSummary.onSave="document.forms.Form1.elements.btnSubmit.click();" 

    //'*************************************************** 
    //' APPLYING STYLESHEET 
    //' (Using external css file) 
    //'*************************************************** 

    txtDesc.Css = "style/test.css"; //'Specify external css file here 

    //'*************************************************** 
    //' APPLYING STYLESHEET 
    //' (Using predefined style rules) 
    //'*************************************************** 

    //'oEditSummary.StyleList = New String(,){ _ 
    //'  {"BODY",false,"","font-family:Verdana,Arial,Helvetica;font-size:x-small;"}, _ 
    //'  {".ScreenText",true,"Screen Text","font-family:Tahoma;"}, _ 
    //'  {".ImportantWords",true,"Important Words","font-weight:bold;"}, _ 
    //'  {".Highlight",true,"Highlight","font-family:Arial;color:red;"}} 

    //'If you'd like to set the default writing to "Right to Left", use: 

    //'oEditSummary.StyleList = New String(,){{"BODY",false,"","direction:rtl;unicode-bidi:bidi-override;"}} 


    //'*************************************************** 
    //' ENABLE ASSET MANAGER ADD-ON 
    //'*************************************************** 

    txtDesc.AssetManagerWidth = 570.ToString(); 
    txtDesc.AssetManagerHeight = 510.ToString(); 
    txtDesc.AssetManager = System.Configuration.ConfigurationManager.AppSettings["EditorPath"].ToString() + "/Editor/assetmanager/assetmanager.aspx"; 
    txtDesc.scriptPath = System.Configuration.ConfigurationManager.AppSettings["EditorPath"].ToString() + "/Editor/scripts/"; 
    //'Use relative to root path (starts with "/") 

    //'*************************************************** 
    //' USING CUSTOM TAG INSERTION FEATURE 
    //'*************************************************** 

    txtDesc.CustomTagList = new String[,]{{"First Name","{%first_name%}"}, 
              {"Last Name","{%last_name%}"}, 
              {"Email","{%email%}"}}; 

    //'*************************************************** 
    //' SETTING COLOR PICKER's CUSTOM COLOR SELECTION 
    //'*************************************************** 
    txtDesc.CustomColors = new String[] { "#ff4500", "#ffa500", "#808000", "#4682b4", "#1e90ff", "#9400d3", "#ff1493", "#a9a9a9" }; 

    //'*************************************************** 
    //' SETTING EDITING MODE 
    //' 
    //' Possible values: 
    //'  - "HTMLBody" (default) 
    //'  - "XHTMLBody" 
    //'  - "HTML" 
    //'  - "XHTML" 
    //'*************************************************** 

    txtDesc.EditMode = "XHTMLBody"; 

我想給予必要的字段驗證。 那麼如何可能?

回答