Share via


QueryResultBase.GenerateQueryString Method

The GenerateQueryString method of the QueryResultBase class processes the query template and replaces placeholders with run-time values.

Namespace:  Microsoft.SharePoint.Portal.WebControls
Assembly:  Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)

Syntax

'Declaration
Protected Overridable Function GenerateQueryString ( _
    strKeyword As String, _
    rgScopeList As ArrayList, _
    strWhereAndPart As String, _
    <OutAttribute> ByRef strSavedQuery As String _
) As String
'Usage
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
)

Parameters

  • strKeyword
    Type: System.String
    Keywords to include in the query.
  • strWhereAndPart
    Type: System.String
    WHERE clause to include in the query.
  • strSavedQuery
    Type: System.String
    Out parameter that receives the resulting query.

Return Value

Type: System.String
String that contains the resulting query.

Remarks

The GenerateQueryString method replaces placeholders in the query template with run-time values. The placeholders are indicated by "%__ __%" substrings. The following table shows the placeholders implemented in this method, and a short description for each.

Placeholder

Condition

%__keywordinput__%

Replaced with the keywords specified in the search box.

%__keywordinputforcontains__%

Replaced with the keywords specified in the search box, with encoding for query.

%__UserIdentity__%

Replaced with the current user logon value, domain_name\user_name.

%__Scopes__%

Replaced with the specified search scopes.

%__querystring(id)__%

Replaced with HttpRequest.QueryString["id"], if specified.

%__formfield(id)__%

Replace with HttpRequest.Form["id"].

Your can extend the template translation process by overriding this method in your derived class.

See Also

Reference

QueryResultBase Class

QueryResultBase Members

Microsoft.SharePoint.Portal.WebControls Namespace