CompareValidator.ControlPropertiesValidとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CompareValidator.ControlPropertiesValidの意味・解説 

CompareValidator.ControlPropertiesValid メソッド

このメンバは BaseValidator.ControlPropertiesValid をオーバーライドます。
構文構文

Protected Overrides Function
 ControlPropertiesValid As Boolean
Dim returnValue As Boolean

returnValue = Me.ControlPropertiesValid
protected override bool ControlPropertiesValid
 ()
protected:
virtual bool ControlPropertiesValid () override
protected boolean ControlPropertiesValid ()
protected override function ControlPropertiesValid
 () : boolean
バージョン情報バージョン情報
参照参照
関連項目
CompareValidator クラス
CompareValidator メンバ
System.Web.UI.MobileControls 名前空間

CompareValidator.ControlPropertiesValid メソッド

コントロールプロパティ有効な値が設定されているか検証します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Protected Overrides Function
 ControlPropertiesValid As Boolean
Dim returnValue As Boolean

returnValue = Me.ControlPropertiesValid
protected override bool ControlPropertiesValid
 ()
protected:
virtual bool ControlPropertiesValid () override
protected boolean ControlPropertiesValid ()
protected override function ControlPropertiesValid
 () : boolean

戻り値
コントロールプロパティ有効な場合trueそれ以外場合false

使用例使用例

次のコード例では、カスタム サーバー コントロールControlPropertiesValid メソッドオーバーライドして、CompareValidator コントロールの ControlToCompare プロパティページ存在し検証プロパティを含む限り、常に表示プロパティの値を返す方法示します

<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls"
 Assembly="Samples.AspNet.VB"
 %>
<%@ Page language="VB" %>
<HTML>
  <HEAD>
    <title>Custom CompareValidator - ControlPropertiesValid - VB.NET Example</title>
  </HEAD>
  <body>
    <form id="Form1" method="post"
 runat="server">
      <h3>Custom CompareValidator - ControlPropertiesValid - C# Example</h3>
            <asp:TextBox id="TextBox1" runat="server">123</asp:TextBox><BR>
            <aspSample:CustomCompareValidatorControlPropertiesValid
             id="CompareValidator1" runat="server"
 Display="Dynamic"
             ErrorMessage="The value of TextBox1 must be
 '456'."
             ControlToValidate="TextBox1" ValueToCompare="456"
 /><br>
             <asp:Button id="Button1" runat="server"
 Text="Button" />
    </form>
  </body>
</HTML>
<br /><span space="preserve">...</span><br
 />Imports System.Web
Imports System.Security.Permissions

Namespace Samples.AspNet.VB.Controls
    <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)>
 _
    Public NotInheritable Class
 CustomCompareValidatorControlPropertiesValid
        Inherits System.Web.UI.WebControls.CompareValidator

        Protected Overrides Function
 ControlPropertiesValid() As Boolean

            ' Determine whether the ControlToValidate is on the page
 and contains a validation properties. 
            MyBase.CheckControlValidationProperty(Me.ControlToValidate,
 "ControlToValidate")

            ' If the control is visible, then control is valid and ready
 for validation.
            Dim control As System.Web.UI.Control
 = Me.FindControl(Me.ControlToValidate)
            If control.Visible = True Then
                Return True
            Else
                Return False
            End If
        End Function
    End Class
End Namespace
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls"
 Assembly="Samples.AspNet.CS" %>
<%@ Page language="c#" %>
<HTML>
  <HEAD>
    <title>Custom CompareValidator - ControlPropertiesValid - C# Example</title>
    <script runat="server">
      void Page_Load(Object sender, EventArgs e)
      {
        // Run the Page Validate method in order to force
        // the CompareValidate to show it's error message.
        Page.Validate();
      }
    </script>
  </HEAD>
  <body>
    <form id="Form1" method="post" runat="server">
      <h3>Custom CompareValidator - ControlPropertiesValid - C# Example</h3>

      <asp:TextBox id="TextBox1" runat="server">123</asp:TextBox><BR>

      <aspSample:CustomCompareValidatorControlPropertiesValid
        id="CompareValidator1"
        runat="server"
        Display="Dynamic"
        ErrorMessage="The value of TextBox1 must be '456'."
        ControlToValidate="TextBox1"
        ValueToCompare="456" /><br>

      <asp:Button id="Button1" runat="server" Text="Button"
 />

    </form>
  </body>
</HTML>
<br /><span space="preserve">...</span><br />using
 System.Web;
using System.Security.Permissions;

namespace Samples.AspNet.CS.Controls
{
    [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
    public sealed class CustomCompareValidatorControlPropertiesValid
 : System.Web.UI.WebControls.CompareValidator
    {
        protected override bool ControlPropertiesValid()
        {
            // Determine whether the ControlToValidate is on the page
 and contains a validation properties. 
            base.CheckControlValidationProperty(this.ControlToValidate,
 "ControlToValidate");

            // If the control is visible, then control is valid and
 is ready for validation.
            System.Web.UI.Control control = this.FindControl(this.ControlToValidate);
            return control.Visible;
        }
    }
}
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.JSL.Controls"
 Assembly="Samples.AspNet.JSL" %>
<%@ Page language="VJ#" %>
<HTML>
  <HEAD>
    <title>Custom CompareValidator - ControlPropertiesValid - VJ# Example</title>
    <script runat="server">
    void Page_Load(Object sender, EventArgs e)
    {
        // Run the Page Validate method in order to force
        // the CompareValidate to show it's error message.
        get_Page().Validate();
    } //Page_Load
    </script>
  </HEAD>
  <body>
    <form id="Form1" method="post" runat="server">
      <h3>Custom CompareValidator - ControlPropertiesValid - VJ# Example</h3>

      <asp:TextBox id="TextBox1" runat="server" Text="123"></asp:TextBox><BR>

      <aspSample:CustomCompareValidatorControlPropertiesValid
        id="CompareValidator1"
        runat="server"
        Display="Dynamic"
        ErrorMessage="The value of TextBox1 must be '456'."
        ControlToValidate="TextBox1"
        ValueToCompare="456" /><br>

      <asp:Button id="Button1" runat="server" Text="Button"
 />

    </form>
  </body>
</HTML>
<br /><span space="preserve">...</span><br />package
 Samples.AspNet.JSL.Controls;

public class CustomCompareValidatorControlPropertiesValid
    extends System.Web.UI.WebControls.CompareValidator
{
    protected boolean ControlPropertiesValid()
    {
        // Determine whether the ControlToValidate is on the page 
        // and contains a validation properties. 
        super.CheckControlValidationProperty(this.get_ControlToValidate()
,
            "ControlToValidate");
        // If the control is visible, then control is valid and is ready
 
        // for validation.
        System.Web.UI.Control control = 
            this.FindControl(this.get_ControlToValidate());
        return control.get_Visible();
    } //ControlPropertiesValid
} //CustomCompareValidatorControlPropertiesValid
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CompareValidator クラス
CompareValidator メンバ
System.Web.UI.WebControls 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からCompareValidator.ControlPropertiesValidを検索した結果を表示しています。
Weblioに収録されているすべての辞書からCompareValidator.ControlPropertiesValidを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からCompareValidator.ControlPropertiesValid を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CompareValidator.ControlPropertiesValid」の関連用語

CompareValidator.ControlPropertiesValidのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CompareValidator.ControlPropertiesValidのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS