SearchArea Class
System.Object
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.SearchArea
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.SearchArea
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Not updated for SP2010?
"The SearchArea class is the backend code file for the searcharea.ascx user control located in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES directory. "
$0$0
$0
$0Should point to the 14 Hive for SP2010. Also there does not appear to be a SearchArea.ascx in this folder.$0
- 10/12/2010
- jacobUT
SearchArea
Description
The Microsoft.SharePoint.WebControls.SearchArea class inherits from System.Web.UI.UserControl which is the base class for producing orthodox web user controls. The SearchArea class is the backend code file for the searcharea.ascx user control located in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES directory. The search area control is evident as the customary search bar, passing specified search parameters to the search results page. The control is loaded as a delegate control by specifying the control ID, "SearchArea".
The SearchArea class is accountable for querying for particular ToolTip strings from the ViewState if the values are not null. Otherwise, default values are gathered by looking at the SharePoint resource files. The following values are harvested from the ViewState:
SearchImageToolTip – String representation of the ToolTip that is displayed when you hover over the search image in the control
SearchScopeToolTip – String representation of the ToolTip that is displayed when you hover over the scope options in the control
SearchTextToolTip – String representation of the ToolTip that is displayed when you however over the text input in the control
The Usage Scenario
The primary usage of the SearchArea class is internal since it supplies functionality to a shipped user control. The most common location it is brought up is when customizing search controls that are presented on master pages; however this is advisably done by stipulating a distinct ID to a delegate control.
In the below, I am loading the searcharea user control using Page.LoadControl and performing an orthodox cast since the return type will be of type Control. Once the casting has occurred, the proper object properties are available, and the control is added to the current instance control collection.
C# Code Example
protected override void CreateChildControls()
{
var sa = (SearchArea)Page.LoadControl("~/_controltemplates/searcharea.ascx");
Controls.Add(sa);
base.CreateChildControls();
}
Visual Basic .NET Code Example
Protected Overloads Overrides Sub CreateChildControls()
Dim sa As var = DirectCast(Page.LoadControl("~/_controltemplates/searcharea.ascx"), SearchArea)
Controls.Add(sa)
MyBase.CreateChildControls()
End Sub
The Microsoft.SharePoint.WebControls.SearchArea class inherits from System.Web.UI.UserControl which is the base class for producing orthodox web user controls. The SearchArea class is the backend code file for the searcharea.ascx user control located in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES directory. The search area control is evident as the customary search bar, passing specified search parameters to the search results page. The control is loaded as a delegate control by specifying the control ID, "SearchArea".
The SearchArea class is accountable for querying for particular ToolTip strings from the ViewState if the values are not null. Otherwise, default values are gathered by looking at the SharePoint resource files. The following values are harvested from the ViewState:
SearchImageToolTip – String representation of the ToolTip that is displayed when you hover over the search image in the control
SearchScopeToolTip – String representation of the ToolTip that is displayed when you hover over the scope options in the control
SearchTextToolTip – String representation of the ToolTip that is displayed when you however over the text input in the control
The Usage Scenario
The primary usage of the SearchArea class is internal since it supplies functionality to a shipped user control. The most common location it is brought up is when customizing search controls that are presented on master pages; however this is advisably done by stipulating a distinct ID to a delegate control.
In the below, I am loading the searcharea user control using Page.LoadControl and performing an orthodox cast since the return type will be of type Control. Once the casting has occurred, the proper object properties are available, and the control is added to the current instance control collection.
C# Code Example
protected override void CreateChildControls()
{
var sa = (SearchArea)Page.LoadControl("~/_controltemplates/searcharea.ascx");
Controls.Add(sa);
base.CreateChildControls();
}
Visual Basic .NET Code Example
Protected Overloads Overrides Sub CreateChildControls()
Dim sa As var = DirectCast(Page.LoadControl("~/_controltemplates/searcharea.ascx"), SearchArea)
Controls.Add(sa)
MyBase.CreateChildControls()
End Sub
- 6/3/2010
- Adam Buenz - MVP