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

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

Substitution.MethodName プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

Substitution コントロール実行時呼び出すコールバック メソッドの名前を取得または設定します

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

Public Overridable Property
 MethodName As String
Dim instance As Substitution
Dim value As String

value = instance.MethodName

instance.MethodName = value
public virtual string MethodName { get;
 set; }
/** @property */
public String get_MethodName ()

/** @property */
public void set_MethodName (String value)

プロパティ
Substitution コントロール実行時呼び出すメソッドの名前を表す文字列。

解説解説
使用例使用例

Substitution コントロール出力キャッシュ使用する Web ページ宣言によって追加する方法コード例次に示しますページ読み込まれると、静的箇条書きリストユーザー表示されます。ページのこのセクションキャッシュされ、60 秒ごとに更新されます。Substitution コントロールは、実行時GetUser メソッド呼び出します。このメソッド現在のユーザーを表す文字列を返します。この文字列は、ページ上の Substitution コントロール位置表示されます。ページのこのセクションキャッシュされず、ページ表示更新されるたびに更新されます。

<%@ outputcache duration="60" varybyparam="none"
 %>
<script runat="server" language="VB">
  
  
  ' The Substitution control calls this method to retrieve
  ' the name of the current user from the HttpContext object. 
  ' This section of the page is exempt from output caching. 
  Shared Function GetUser(ByVal
 context As HttpContext) As String
    Return context.User.Identity.Name
  End Function
  
</script>

<html>
<head id="Head1" runat="server">
  <title>Substitution.MethodName Property Example</title>
</head>
<body>
  <form id="Form1" runat="server">
  
    <h3>Substitution.MethodName Property Example</h3>
  
    
    <!--This section of the page is not
 cached.-->
    Welcome to the site,
    <asp:substitution id="Substitution1"
      methodname="GetUser"
      runat="Server">
    </asp:substitution>
    
    <br /><br />
    
    <!--This section of the page is cached.-->
    Product list:
    <asp:bulletedlist id="ItemsBulletedList"  
           
      displaymode="Text" 
      runat="server">    
        <asp:ListItem>Product 1</asp:ListItem>
        <asp:ListItem>Product 2</asp:ListItem>
        <asp:ListItem>Product 3</asp:ListItem>
    </asp:bulletedlist>        

  </form>
</body>
</html>
<%@ outputcache duration="60" varybyparam="none" %>
<script runat="server" language="C#">  
  
  // The Substitution control calls this method to retrieve
  // the name of the current user from the HttpContext object. 
  // This section of the page is exempt from output caching. 
  public static string GetUser(HttpContext
 context)
  {
    return context.User.Identity.Name;
  }
  
</script>

<html>
<head id="Head1" runat="server">
  <title>Substitution.MethodName Property Example</title>
</head>
<body>
  <form id="Form1" runat="server">
  
    <h3>Substitution.MethodName Property Example</h3>  
    
    <!--This section of the page is not cached.-->
    Welcome to the site,
    <asp:substitution id="Substitution1"
      methodname="GetUser"
      runat="Server">
    </asp:substitution>
    
    <br /><br />
    
    <!--This section of the page is cached.-->
    Product list:
    <asp:bulletedlist id="ItemsBulletedList"             
      displaymode="Text" 
      runat="server">    
        <asp:ListItem>Product 1</asp:ListItem>
        <asp:ListItem>Product 2</asp:ListItem>
        <asp:ListItem>Product 3</asp:ListItem>
    </asp:bulletedlist>        

  </form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Substitution.MethodName プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS