QueryResultBase.GenerateQueryString メソッド (Microsoft.SharePoint.Portal.WebControls)
QueryResultBase クラスの GenerateQueryString メソッドはクエリ テンプレートを処理し、プレースホルダを実行時の値に置き換えます。
名前空間: Microsoft.SharePoint.Portal.WebControls
アセンブリ: Microsoft.SharePoint.Portal (microsoft.sharepoint.portal.dll 内)
構文
'宣言
Protected Overridable Function GenerateQueryString ( _
strKeyword As String, _
rgScopeList As ArrayList, _
strWhereAndPart As String, _
<OutAttribute> ByRef strSavedQuery As String _
) As String
'使用
Dim strKeyword As String
Dim rgScopeList As ArrayList
Dim strWhereAndPart As String
Dim strSavedQuery As String
Dim returnValue As String
returnValue = Me.GenerateQueryString(strKeyword, rgScopeList, strWhereAndPart, strSavedQuery)
protected virtual string GenerateQueryString (
string strKeyword,
ArrayList rgScopeList,
string strWhereAndPart,
out string strSavedQuery
)
パラメータ
- strKeyword
クエリに含めるキーワード。
- rgScopeList
クエリに含める検索範囲の配列。
- strWhereAndPart
クエリに含める WHERE 句。
- strSavedQuery
結果として生成されたクエリを受け取る出力パラメータ。
戻り値
結果として生成されたクエリを含む文字列。
備考
GenerateQueryString メソッドは、クエリ テンプレートのプレースホルダを実行時の値に置き換えます。プレースホルダは、"%__ __%" 部分文字列で示されます。以下の表は、このメソッドに実装されているプレースホルダと、各プレースホルダの簡単な説明を示しています。
プレースホルダ |
条件 |
---|---|
%__keywordinput__% |
検索ボックスで指定されたキーワードに置き換えられます。 |
%__keywordinputforcontains__% |
クエリのエンコードを使用して、検索ボックスで指定されたキーワードに置き換えられます。 |
%__UserIdentity__% |
現在のユーザーのログオン値 (domain_name\user_name) に置き換えられます。 |
%__Scopes__% |
指定された検索範囲に置き換えられます。 |
%__querystring(id)__% |
指定されている場合は、HttpRequest.QueryString["id"] に置き換えられます。 |
%__formfield(id)__% |
HttpRequest.Form["id"] に置き換えられます。 |
テンプレートの変換処理は、このメソッドを派生クラスでオーバーライドすることによって拡張できます。
関連項目
参照
QueryResultBase クラス
QueryResultBase メンバ
Microsoft.SharePoint.Portal.WebControls 名前空間