ESRI.ArcGIS.ADF.Web.UI.WebControls
IMapServerDropDownBoxAction Interface
Members  Example  See Also 
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:http).

See Also

© 2010 All Rights Reserved.