Share via


Query.SafeQueryPropertiesTemplateUrl property

Specifies the location of the QueryProperties template. This property must be specified when issuing a query by a user who does not have UseRemoteAPIs() permission enabled. If the query will not run without UseRemoteAPIs() permission enabled, you can set the IgnoreSafeQueryPropertiesTemplateUrl property to true instead.

Namespace:  Microsoft.Office.Server.Search.Query
Assembly:  Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)

Syntax

'Declaration
Public Property SafeQueryPropertiesTemplateUrl As String
    Get
    Set
'Usage
Dim instance As Query
Dim value As String

value = instance.SafeQueryPropertiesTemplateUrl

instance.SafeQueryPropertiesTemplateUrl = value
public string SafeQueryPropertiesTemplateUrl { get; set; }

Property value

Type: System.String

Remarks

By default, UseRemoteAPIs() is not granted to anonymous users.

The specified URL must use scheme "webpart" or "file". The host should be "webroot". For "webpart" URLs, the path must be web-relative path of the page on which the Web Part is placed. The query string of the URL must contain the key "id" with a value that contains a Web Part ID. For example: webpart://webroot/Pages/results.aspx?id=4. For "file" URLs, the path must be web-relative path of the file which contains the serialized QueryProperties template.

See also

Reference

Query class

Query members

Microsoft.Office.Server.Search.Query namespace