ESRI.ArcGIS.ADF.Web.UI.WebControls
IMapServerDropDownBoxAction Interface
Members  Example  See Also  Send Feedback
ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools Namespace : IMapServerDropDownBoxAction Interface




The interface that must be implemented in order for a class to function as the server-side action of a DropDownBox.

Syntax

Visual Basic (Declaration) 
Public Interface IMapServerDropDownBoxAction 
   Inherits IServerAction 
Visual Basic (Usage)Copy Code
Dim instance As IMapServerDropDownBoxAction
C# 
public interface IMapServerDropDownBoxAction : IServerAction  

Example

This example demonstrates how to obtain the value that the user selected in the DropDownBox that called the server-side action. This code assumes that the Name of the DropDownBox is set to "MyDropDownBox".
C#Copy Code
public class MyDropDownBoxAction : IMapServerDropDownBoxAction
{
    void IServerAction.ServerAction(ToolbarItemInfo info)
    {
        DropDownBox ddb = 
           (DropDownBox)info.Toolbar.ToolbarItems.Find("MyDropDownBox");
        string selectedDropDownValue = ddb.SelectedValue;
        
        // do something with the selected value...
    }
}
Visual BasicCopy Code
Public Class MyDropDownBoxAction
    Implements IMapServerDropDownBoxAction
 
    Sub ServerAction(ByVal info As ToolbarItemInfo) _
        Implements IServerAction.ServerAction
    
        Dim ddb As DropDownBox = _ 
           CType(info.Toolbar.ToolbarItems.Find("MyDropDownBox"), DropDownBox)
        Dim selectedDropDownValue As String = ddb.SelectedValue
        
        ' Do something With the selected value...
        
    End Sub
End Class

Remarks

In order for a DropDownBox to perform an action on the server for Map, a class must be created that implements this interface. The DropDownBox then sets its ServerActionClass to this class, typically at design time in the toolbar items editor.

The class implements the ServerAction method. This method handles the server-side action. This method received one argument, a ToolbarItemInfo object. This object contains information about the item, toolbar and buddy controls of the toolbar. The buddy controls collection may be used to obtain a reference to the Map, as discussed at ToolbarItemInfo.BuddyControls.

The ServerAction method does not directly receive information about the item that the user selected in the DropDownBox. Instead, code must be used to obtain the value selected in the DropDownBox. See the Example for an illustration of getting the selected value.

For another example of using this interface, see the Common_AddCustomTool sample in the SDK Web Applications samples (also available at ArcGIS Resource Center).

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2011 All Rights Reserved.