0

asp.net Webフォームでサードパーティのwysiwygエディターを使用しており、その登録

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

これがその戻り値のコードです

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

csファイルでは、これは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";

必須フィールドの検証を行いたい。では、どのように可能ですか?

4

1 に答える 1

0

私はこれについていくつか読んだことがありますが、あなたの最善の解決策はあなたのコントロールにカスタムバリデーターを実装することだと思われます.クライアント側とサーバー側の実装を問題なく提供できます.

http://www.codeproject.com/Articles/3882/ASP-NET-Validators-Unclouded

カスタムバリデータのセクションを参照してください。

于 2012-08-17T08:57:19.450 に答える