Command.CommandArgument プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Command.CommandArgument プロパティの意味・解説 

Command.CommandArgument プロパティ

ItemCommand イベントコマンド関連付けられた引数設定するか、または返します既定値空の文字列 ("") です。

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

<BindableAttribute(True)> _
Public Property CommandArgument As
 String
Dim instance As Command
Dim value As String

value = instance.CommandArgument

instance.CommandArgument = value
[BindableAttribute(true)] 
public string CommandArgument { get;
 set; }
[BindableAttribute(true)] 
public:
property String^ CommandArgument {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_CommandArgument ()

/** @property */
public void set_CommandArgument (String value)
public function get CommandArgument
 () : String

public function set CommandArgument
 (value : String)

プロパティ
ItemCommandコマンド関連付けられた引数

使用例使用例

CommandArgument プロパティ使用して値を表示する方法次のコード例示します

メモメモ

次のコード例はシングルファイル コード モデル使用しており、分離コード ファイル直接コピーされ場合正常に動作しない可能性あります。このコード例は、拡張子.aspx の空のテキスト ファイルコピーする必要があります詳細については、「ASP.NET Web ページコード モデル」を参照してください

<%@ Page Language="VB" 
    Inherits="System.Web.UI.MobileControls.MobilePage"
 %>
<%@ Register TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls"
 
    Assembly="System.Web.Mobile"
 %>

<script runat="server">
    Private Sub cmd_OnItemCommand(ByVal
 sender As Object, ByVal
 e As CommandEventArgs)
        ' Create variables for data
        Dim txt1 As String
 = "Today's quote of {0} is {1}"
        Dim txt2 As String
 = "Yesterday's quote of {0} was {1}"
        Dim Val As Integer
 = (Convert.ToInt32(e.CommandArgument) - 5)
        
        ' Set the text values of the labels
        message1.Text = String.Format(txt1, e.CommandName, _
            e.CommandArgument)
        message2.Text = String.Format(txt2, e.CommandName, Val)
    End Sub
</script>

<html  >
<body>
    <mobile:form id="form1" runat="server">
        <p>
            <mobile:label id="message1" runat="server">
                Click the button for quotes
            </mobile:label>
            <mobile:label id="message2" runat="server"
 />
        </p>
        <mobile:command id="CmdA" Format="Link"
 
            onItemCommand="cmd_OnItemCommand"
            CommandArgument="70" CommandName="ca"
 
            runat="server" Text="Company
 A" />
        <mobile:command id="CmdB" Format="Link"
            onItemCommand ="cmd_OnItemCommand" 
            CommandArgument="25" CommandName="cb"
 
            runat="server" Text="Company
 B" />
        <mobile:command id="CmdC" Format="Button"
 
            OnItemCommand="cmd_OnItemCommand"
            CommandArgument="110" CommandName="cc"
 
            runat="server" Text="Company
 C" />
    </mobile:form>
</body>
</html>
<%@ Page Language="C#" 
    Inherits="System.Web.UI.MobileControls.MobilePage" %>
<%@ Register TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" %>

<script runat="server">
    void cmd_OnItemCommand(object sender, CommandEventArgs e)
    {
        // Create variables for data
        string txt1 = "Today's quote of {0} is {1}";
        string txt2 = "Yesterday's quote of {0} was {1}";
        int val = (Convert.ToInt32(e.CommandArgument) - 5);
        
        // Set the text values of the labels
        message1.Text = String.Format(txt1, e.CommandName, 
            e.CommandArgument);
        message2.Text = String.Format(txt2, e.CommandName, val);
    }
</script>

<html  >
<body>
    <mobile:form id="form1" runat="server">
        <p>
            <mobile:label id="message1" runat="server">
                Click the button for quotes
            </mobile:label>
            <mobile:label id="message2" runat="server" />
        </p>
        <mobile:command id="CmdA" Format="Link" 
            onItemCommand ="cmd_OnItemCommand" 
            CommandArgument="70" CommandName="ca" 
            runat="server" Text="Company A" />
        <mobile:command id="CmdB" Format="Link" 
            onItemCommand ="cmd_OnItemCommand" 
            CommandArgument="25" CommandName="cb" 
            runat="server" Text="Company B" />
        <mobile:command id="CmdC" Format="Button" 
            OnItemCommand ="cmd_OnItemCommand" 
            CommandArgument="110" CommandName="cc" 
            runat="server" Text= "Company C" />
    </mobile:form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「Command.CommandArgument プロパティ」の関連用語

Command.CommandArgument プロパティのお隣キーワード
検索ランキング

   

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



Command.CommandArgument プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS