Bing.AdvancedSearchBox Method

Displays a search box and returns results in the Web page.

Namespace:  Microsoft.Web.Helpers
Assembly:  Microsoft.Web.Helpers (in Microsoft.Web.Helpers.dll)

Syntax

'Declaration
Public Shared Function AdvancedSearchBox ( _
    boxWidth As String, _
    resultWidth As Integer, _
    resultHeight As Integer, _
    themeColor As String, _
    locale As String _
) As IHtmlString
'Usage
Dim boxWidth As String
Dim resultWidth As Integer
Dim resultHeight As Integer
Dim themeColor As String
Dim locale As String
Dim returnValue As IHtmlString

returnValue = Bing.AdvancedSearchBox(boxWidth, _
    resultWidth, resultHeight, themeColor, _
    locale)
public static IHtmlString AdvancedSearchBox(
    string boxWidth,
    int resultWidth,
    int resultHeight,
    string themeColor,
    string locale
)
public:
static IHtmlString^ AdvancedSearchBox(
    String^ boxWidth, 
    int resultWidth, 
    int resultHeight, 
    String^ themeColor, 
    String^ locale
)
public static function AdvancedSearchBox(
    boxWidth : String, 
    resultWidth : int, 
    resultHeight : int, 
    themeColor : String, 
    locale : String
) : IHtmlString

Parameters

  • boxWidth
    Type: System.String
    (Optional) The width of the search box. The default value is 322 pixels.
  • resultWidth
    Type: System.Int32
    (Optional) The width, in pixels, of the results pane. The default value is 600.
  • resultHeight
    Type: System.Int32
    (Optional) The height of the results pane. The default value is 400.
  • themeColor
    Type: System.String
    (Optional) The color to use for the results pane theme. The default value is "Blue".
  • locale
    Type: System.String
    (Optional) The locale of the returned results. The default value is "en-US".

Return Value

Type: IHtmlString
An HTML snippet that contains the search results.

Remarks

The AdvancedSearchBox method renders a search box without radio buttons. However, instead of just redirecting to the Bing site, the helper gets the search results and then formats and displays them in the page.

Locales are specified using a two-part term like "en-US" (English, USA), "en-GB" (English, Great Britain), "es-MX" (Spanish, Mexico), "fr-CA" (French, Canada), and so on. You can find a list by searching the Web for "locale codes."

Examples

The following example shows how to use the AdvancedSearchBox method to provide search capabilities.

Permissions

  • Medium trust for the immediate caller. This member can be used by partially trusted code.

See Also

Reference

Bing Class

Microsoft.Web.Helpers Namespace