Example #1
0
        public override void Render(WmlMobileTextWriter writer)
        {
            String formsAuthCookieName = FormsAuthentication.FormsCookieName;

            if (!Device.SupportsRedirectWithCookie)
            {
                if (formsAuthCookieName != String.Empty)
                {
                    HttpContext.Current.Response.Cookies.Remove(formsAuthCookieName);
                }
            }

            writer.BeginForm(Control);
            if (Page.Adapter.PersistCookielessData &&
                Device.CanRenderOneventAndPrevElementsTogether &&
                formsAuthCookieName != null &&
                formsAuthCookieName != String.Empty &&
                Control == Page.ActiveForm)
            {
                IDictionary dictionary = PageAdapter.CookielessDataDictionary;
                if (dictionary != null)
                {
                    String value = (String)dictionary[formsAuthCookieName];
                    if ((value != null) && (value != String.Empty))
                    {
                        writer.AddFormVariable("__facn", value, false);
                    }
                }
            }
            MobileControl secondaryUIControl = SecondaryUIControl as MobileControl;

            writer.EnterLayout(Style);
            if (secondaryUIControl != null && secondaryUIControl.Form == Control)
            {
                SetControlPageRecursive(secondaryUIControl, -1);
                secondaryUIControl.RenderControl(writer);
            }
            else
            {
                if (Control.HasControls())
                {
                    Panel header = Control.Header;
                    Panel footer = Control.Footer;

                    if (header != null)
                    {
                        writer.BeginCustomMarkup();
                        header.RenderControl(writer);
                        writer.EndCustomMarkup();
                    }

                    foreach (Control control in Control.Controls)
                    {
                        if (control != header && control != footer)
                        {
                            control.RenderControl(writer);
                        }
                    }

                    RenderPager(writer);

                    if (footer != null)
                    {
                        writer.BeginCustomMarkup();
                        footer.RenderControl(writer);
                        writer.EndCustomMarkup();
                    }
                }
                else
                {
                    RenderPager(writer);
                }
            }
            writer.ExitLayout(Style);
            writer.EndForm();
        }