チェンジセット 1686 (default)


以下の違いを無視:
日時:
2024/09/06 16:20:59 (4週前)
更新者:
hizuya@…
ログメッセージ:
  • HTML フォームのバリデーションを無効にする機能を追加。
場所:
framework/trunk
ファイル:
3個の追加
4個の更新

凡例:

未変更
追加
削除
  • framework/trunk/WebApplication/WebApplication.csproj

    r1685 r1686  
    7777    <Content Include="UI\WebControls\DialogPageNestedFormViewPage.aspx" /> 
    7878    <Content Include="UI\WebControls\FileUploadPage.aspx" /> 
     79    <Content Include="UI\WebControls\FormPage.aspx" /> 
    7980    <Content Include="UI\WebControls\FormViewBindUserControl1.ascx" /> 
    8081    <Content Include="UI\WebControls\FormViewPage.aspx" /> 
     
    360361    <Compile Include="UI\WebControls\FileUploadPage.aspx.designer.cs"> 
    361362      <DependentUpon>FileUploadPage.aspx</DependentUpon> 
     363    </Compile> 
     364    <Compile Include="UI\WebControls\FormPage.aspx.cs"> 
     365      <DependentUpon>FormPage.aspx</DependentUpon> 
     366      <SubType>ASPXCodeBehind</SubType> 
     367    </Compile> 
     368    <Compile Include="UI\WebControls\FormPage.aspx.designer.cs"> 
     369      <DependentUpon>FormPage.aspx</DependentUpon> 
    362370    </Compile> 
    363371    <Compile Include="UI\WebControls\FormViewBindUserControl1.ascx.cs"> 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/Button.cs

    r1676 r1686  
    3838    { 
    3939        /// <summary> 
     40        /// <see cref="SuppressHtmlValidation"/> プロパティ用のキー。 
     41        /// </summary> 
     42        private const string SuppressHtmlValidationKey = "SuppressHtmlValidation"; 
     43 
     44 
     45        /// <summary> 
    4046        /// <see cref="RaiseEventWithIsNotValid"/> プロパティ用のキー。 
    4147        /// </summary> 
     
    6167        } 
    6268 
     69 
     70        /// <summary> 
     71        /// HTML のフォームバリデーションを抑制するかどうかを取得または設定します。 
     72        /// </summary> 
     73        /// <value> 
     74        /// HTML のフォームバリデーションを抑制する場合は <see langword="true"/>、 
     75        /// それ以外の場合は <see langword="false"/>。 
     76        /// 既定値は <see langword="false"/> です。 
     77        /// </value> 
     78        [Themeable(false)] 
     79        [DefaultValue(false)] 
     80        [WebCategory("Behavior")] 
     81        [WebDescription("Description_SuppressHtmlValidation")] 
     82        public virtual bool SuppressHtmlValidation 
     83        { 
     84            get 
     85            { 
     86                return (bool)(ViewState[SuppressHtmlValidationKey] ?? false); 
     87            } 
     88 
     89            set 
     90            { 
     91                ViewState[SuppressHtmlValidationKey] = value; 
     92            } 
     93        } 
    6394 
    6495        /// <summary> 
     
    187218            base.AddAttributesToRender(writer); 
    188219 
     220            if (SuppressHtmlValidation) 
     221            { 
     222                writer.AddAttribute(Utility.FormNoValidateAttributeName, Utility.FormNoValidateAttributeName); 
     223            } 
     224 
    189225            // 確認ダイアログとの連携 
    190226            if (!DesignMode && IsEnabled) 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/Form.cs

    r1665 r1686  
    2222namespace FCSoft.SilverFrost.Framework.Web.UI.WebControls 
    2323{ 
     24    using System; 
     25    using System.ComponentModel; 
    2426    using System.Web; 
    2527    using System.Web.UI; 
    2628    using System.Web.UI.HtmlControls; 
     29    using System.Web.UI.WebControls; 
    2730 
    2831 
     
    3437    { 
    3538        /// <summary> 
     39        /// <see cref="SuppressHtmlValidation"/> プロパティ用のキー。 
     40        /// </summary> 
     41        private const string SuppressHtmlValidationKey = "SuppressHtmlValidation"; 
     42 
     43 
     44        /// <summary> 
    3645        /// インスタンスを作成します。 
    3746        /// </summary> 
     
    3948        { 
    4049            // AVOID 
     50        } 
     51 
     52 
     53        /// <summary> 
     54        /// HTML バリデーションを抑制するかどうかを取得または設定します。 
     55        /// </summary> 
     56        /// <value> 
     57        /// HTML バリデーションを抑制する場合は <see langword="true"/>、 
     58        /// それ以外の場合は <see langword="false"/>。 
     59        /// 既定値は <see langword="false"/> です。 
     60        /// </value> 
     61        [Themeable(false)] 
     62        [DefaultValue(false)] 
     63        [WebCategory("Behavior")] 
     64        [WebDescription("Description_SuppressHtmlValidation")] 
     65        public virtual bool SuppressHtmlValidation 
     66        { 
     67            get 
     68            { 
     69                return (bool)(ViewState[SuppressHtmlValidationKey] ?? false); 
     70            } 
     71 
     72            set 
     73            { 
     74                ViewState[SuppressHtmlValidationKey] = value; 
     75            } 
     76        } 
     77 
     78 
     79        /// <summary> 
     80        /// 指定した <see cref="HtmlTextWriter" /> オブジェクトに、 
     81        /// <see cref="Form" /> コントロールの属性をレンダリングします。 
     82        /// </summary> 
     83        /// <param name="writer">表示される内容を受け取る <see cref="HtmlTextWriter" />。</param> 
     84        /// <exception cref="InvalidOperationException"> 
     85        /// <see cref="HtmlForm.DefaultButton" /> プロパティに設定されたコントロール ID の型は 
     86        /// <see cref="IButtonControl" /> ではありません。 
     87        /// </exception> 
     88        protected override void RenderAttributes(HtmlTextWriter writer) 
     89        { 
     90            const string NoValidateAttributeName = @"novalidate"; 
     91 
     92            Attributes.Remove(NoValidateAttributeName); 
     93 
     94            // 親を呼び出す 
     95            base.RenderAttributes(writer); 
     96 
     97            if (SuppressHtmlValidation) 
     98            { 
     99                writer.WriteAttribute(NoValidateAttributeName, NoValidateAttributeName); 
     100            } 
    41101        } 
    42102 
  • framework/trunk/WebLibrary/Sources/Utility.cs

    r1685 r1686  
    4848    { 
    4949        /// <summary> 
     50        /// <c>formnovalidate</c> 属性名を表す文字列。 
     51        /// </summary> 
     52        internal const string FormNoValidateAttributeName = @"formnovalidate"; 
     53 
     54        /// <summary> 
    5055        /// 認証が必要だとマークに使用する <see cref="HttpContext.Items"/> のキー。 
    5156        /// </summary> 
詳しい使い方は TracChangeset を参照してください。