private void OpenMenu()
        {
            // Close any character formatting tags before starting a <do>.
            CloseCharacterFormat();

            String           menuTarget;
            String           menuTargetClientID;
            WmlPostFieldType postFieldType;

            if (CurrentCard.ExternalSubmitMenu)
            {
                menuTarget         = null;
                menuTargetClientID = null;
                postFieldType      = WmlPostFieldType.Submit;
            }
            else
            {
                if (CurrentCard.MenuTarget != null)
                {
                    menuTarget = CurrentCard.MenuTarget;
                    if (menuTarget.IndexOf(":", StringComparison.Ordinal) >= 0)
                    {
                        menuTargetClientID = menuTarget.Replace(":", "_");
                    }
                    else
                    {
                        menuTargetClientID = menuTarget;
                    }
                }
                else
                {
                    menuTarget         = CurrentForm.UniqueID;
                    menuTargetClientID = CurrentForm.ClientID;
                }

                postFieldType = WmlPostFieldType.Variable;
            }

            if (!_canRenderMixedSelects)
            {
                _optionMenuName    = menuTarget;
                menuTargetClientID = null;
            }
            else
            {
                String GoLabel = SR.GetString(SR.WmlMobileTextWriterGoLabel);
                RenderDoEvent("accept",
                              menuTarget,
                              menuTargetClientID != null ? MapClientIDToShortName(menuTargetClientID, false) : null,
                              postFieldType,
                              GoLabel,
                              true);
            }

            base.RenderBeginSelect(menuTargetClientID, null, null, null, false);

            CurrentCard.MenuOpened = true;
        }
        /// <include file='doc\HtmlObjectListAdapter.uex' path='docs/doc[@for="HtmlObjectListAdapter.HandlePostBackEvent"]/*' />
        public override bool HandlePostBackEvent(String eventArgument)
        {
            switch (Control.ViewMode)
            {
            case ObjectListViewMode.List:

                // DCR 2493 - raise a selection event, and only continue
                // handling if asked to.

                if (eventArgument.StartsWith(ShowMore, StringComparison.Ordinal))
                {
                    int itemIndex = ParseItemArg(eventArgument);

                    if (Control.SelectListItem(itemIndex, true))
                    {
                        if (Control.SelectedIndex > -1)
                        {
                            // ObjectListViewMode.Commands and .Details same for HTML,
                            // but cannot access ObjLst.Details in Commands mode.
                            Control.ViewMode = ObjectListViewMode.Details;
                        }
                    }
                }
                else
                {
                    int itemIndex = -1;
                    try
                    {
                        itemIndex = Int32.Parse(eventArgument, CultureInfo.InvariantCulture);
                    }
                    catch (System.FormatException)
                    {
                        throw new Exception(SR.GetString(SR.ObjectListAdapter_InvalidPostedData));
                    }
                    if (Control.SelectListItem(itemIndex, false))
                    {
                        Control.RaiseDefaultItemEvent(itemIndex);
                    }
                }
                return(true);

            case ObjectListViewMode.Commands:
            case ObjectListViewMode.Details:

                if (eventArgument == BackToList)
                {
                    Control.ViewMode = ObjectListViewMode.List;
                    return(true);
                }
                break;
            }

            return(false);
        }
        private void RenderCardClosing(int cardIndex)
        {
            UpCard card = (UpCard)_cards[cardIndex];

            if (cardIndex < _cards.Count - 1 && !card.NoOKLink)
            {
                // Add a link to go to the next card.

                UpCard nextCard = (UpCard)_cards[cardIndex + 1];
                String OkLabel  = SR.GetString(SR.WmlMobileTextWriterOKLabel);
                RenderBeginHyperlink("#" + nextCard.Id, false, OkLabel, true, true);
                RenderText(OkLabel);
                RenderEndHyperlink(true);
            }

            if (card.RenderAsMenu)
            {
                CloseMenu();
            }
        }