public override void Render(HtmlMobileTextWriter writer)
        {
            String additionalStyle;

            Alignment alignment = (Alignment) Style[Style.AlignmentKey, true];
            Wrapping wrapping = (Wrapping) Style[Style.WrappingKey, true];
            bool wrap = (wrapping == Wrapping.Wrap || wrapping == Wrapping.NotSet);
            String width = DesignerAdapterUtil.GetWidth(Control);

            ((DesignerTextWriter)writer).EnterZeroFontSizeTag();
            writer.EnterLayout(Style);
            writer.WriteBeginTag("div");
            if (!wrap)
            {
                byte templateStatus;
                int maxWidth = DesignerAdapterUtil.GetMaxWidthToFit(Control, out templateStatus);
                if (templateStatus == DesignerAdapterUtil.CONTROL_IN_TEMPLATE_EDIT)
                {
                    width = maxWidth.ToString(CultureInfo.InvariantCulture) + "px";
                }
                additionalStyle = "overflow-x:hidden;width:" + width + ";";
            }
            else
            {
                additionalStyle = "word-wrap:break-word;width:" + width + ";";
            }

            ((DesignerTextWriter)writer).WriteStyleAttribute(Style, additionalStyle);
            if (alignment != Alignment.NotSet)
            {
                writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
            }
            writer.Write(">");

            writer.WriteText(Control.HeaderText, true);
            
            writer.WriteFullBeginTag("ul");
            for (int i = 1; i <= 2; i++)
            {
                writer.WriteFullBeginTag("li");
                writer.Write(SR.GetString(SR.ValidationSummary_ErrorMessage, i.ToString(CultureInfo.InvariantCulture)));
                writer.WriteEndTag("li");
            }
            writer.WriteEndTag("ul");

            writer.WriteBeginTag("a");
            writer.WriteAttribute("href", "NavigationUrl");
            writer.Write(">");
            writer.WriteText(String.IsNullOrEmpty(Control.BackLabel) ? GetDefaultLabel(BackLabel) : Control.BackLabel, true);
            writer.WriteEndTag("a");

            writer.WriteEndTag("div");
            writer.ExitLayout(Style);
            ((DesignerTextWriter)writer).ExitZeroFontSizeTag();
        }
 public unsafe override void Render(HtmlMobileTextWriter writer)
 {
     string str;
     Alignment alignment = *((Alignment*) base.get_Style().get_Item(Style.AlignmentKey, true));
     Wrapping wrapping = *((Wrapping*) base.get_Style().get_Item(Style.WrappingKey, true));
     bool flag = (wrapping == 1) || (wrapping == 0);
     string str2 = "100%";
     Utils.EnterZeroFontSizeTag(writer);
     writer.EnterLayout(base.get_Style());
     writer.WriteBeginTag("div");
     if (!flag)
     {
         str = "overflow-x:hidden;width:" + str2 + ";";
     }
     else
     {
         str = "word-wrap:break-word;width:" + str2 + ";";
     }
     Utils.WriteStyleAttribute(writer, base.get_Style(), str);
     if (alignment != null)
     {
         writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
     }
     writer.Write(">");
     writer.WriteText(base.get_Control().get_HeaderText(), true);
     writer.WriteFullBeginTag("ul");
     for (int i = 1; i <= 2; i++)
     {
         writer.WriteFullBeginTag("li");
         writer.Write(Constants.ValidationSummaryErrorMessage, i.ToString());
         writer.WriteEndTag("li");
     }
     writer.WriteEndTag("ul");
     writer.WriteBeginTag("a");
     writer.WriteAttribute("href", "NavigationUrl");
     writer.Write(">");
     writer.WriteText((base.get_Control().get_BackLabel() == string.Empty) ? base.GetDefaultLabel(ControlAdapter.BackLabel) : base.get_Control().get_BackLabel(), true);
     writer.WriteEndTag("a");
     writer.WriteEndTag("div");
     writer.ExitLayout(base.get_Style());
     Utils.ExitZeroFontSizeTag(writer);
 }
 /// <include file='doc\HtmlPageAdapter.uex' path='docs/doc[@for="HtmlPageAdapter.RenderForm"]/*' />
 public virtual void RenderForm(HtmlMobileTextWriter writer, Form form)
 {
     writer.BeginFile(GetFormUrl(form), "text/html", Page.Response.Charset);
     writer.WriteFullBeginTag("html");
     form.RenderControl(writer);
     if (Device.RequiresDBCSCharacter)
     {
         // Insert a comment with a space
         writer.Write("<!--\u3000-->");
     }
     writer.WriteEndTag("html");
     writer.EndFile();
 }
        /// <include file='doc\HtmlFormAdapter.uex' path='docs/doc[@for="HtmlFormAdapter.Render"]/*' />
        public override void Render(HtmlMobileTextWriter writer)
        {
            Color backColor = (Color)Style[Style.BackColorKey, true];
            String title = Control.Title;
            bool isTitleEmpty = String.IsNullOrEmpty(title);

            bool willWriteHeadElements =
                !isTitleEmpty ||
                RenderExtraHeadElements(null);

            if (willWriteHeadElements)
            {
                writer.Write("\r\n");
                writer.WriteFullBeginTag("head");
            }

            if (!isTitleEmpty)
            {
                writer.Write("\r\n");
                writer.WriteFullBeginTag("title");
                writer.Write(title);
                writer.WriteEndTag("title");
                writer.Write("\r\n");
            }

            _renderPager = true;

            RenderExtraHeadElements(writer);

            if (willWriteHeadElements)
            {
                writer.WriteEndTag("head");
                writer.Write("\r\n");
            }

            IDictionary bodyAttributes = new ListDictionary();
            if ((backColor != Color.Empty) && (writer.RenderBodyColor))
            {
                bodyAttributes.Add("bgcolor", ColorTranslator.ToHtml(backColor));
            }
            RenderBodyTag(writer, bodyAttributes);

            bool formTagRequired = ShouldRenderFormTag();
            if (formTagRequired)
            {
                writer.WriteBeginTag("form");
                writer.WriteAttribute("id", Control.ClientID);
                writer.WriteAttribute("name", Control.ClientID);
                writer.WriteAttribute("method", Control.Method.ToString().ToLower(CultureInfo.InvariantCulture));
                writer.Write(" action=\"");

                if (Control.Action.Length > 0)
                {
                    // AUI 3652
                    String url = Control.ResolveUrl(Control.Action);

                    if (!Device.SupportsQueryStringInFormAction)
                    {
                        // If query string is not supported, we don't write
                        // it here, and the query string will be added as
                        // hidden variables later.
                        int i = url.IndexOf('?');
                        if (i != -1)
                        {
                            url = url.Substring(0, i);
                        }
                    }

                    writer.Write(url);
                }
                else
                {
                    writer.WriteEncodedUrl(Page.RelativeFilePath);

                    if (Device.SupportsQueryStringInFormAction)
                    {
                        writer.Write("?");
                        writer.Write(Page.UniqueFilePathSuffix);
                        if (Control.Method != FormMethod.Get)
                        {
                            String queryStringText = Page.QueryStringText;
                            if (queryStringText != null && queryStringText.Length > 0)
                            {
                                writer.Write('&');
                                writer.Write(queryStringText);
                            }
                        }
                    }
                }

                writer.Write("\"");
                writer.Write(">\r\n");

                PageAdapter.RenderPostBackHeader(writer, Control);

                // Renders hidden variables for IPostBackDataHandlers which are
                // not displayed due to pagination or secondary UI.
                RenderOffPageVariables(writer, Control, Control.CurrentPage);
            }

            writer.EnterStyle(Style);

            writer.BeforeFirstControlWritten = true;

            MobileControl secondaryUIControl = SecondaryUIControl as MobileControl;

            if (secondaryUIControl != null && secondaryUIControl.Form == Control)
            {
                bool secondaryUIInHeaderOrFooter = IsControlInFormHeader(secondaryUIControl) 
                    || IsControlInFormFooter(secondaryUIControl);


                SetControlPageRecursive(secondaryUIControl, -1);
                if(Control.Header != null && !secondaryUIInHeaderOrFooter)
                {
                     Control.Header.RenderControl(writer);
                }
                secondaryUIControl.RenderControl(writer);
                if(Control.Footer != null && !secondaryUIInHeaderOrFooter)
                {
                    Control.Footer.RenderControl(writer);
                }
            }
            else
            {

                bool pagerRendered = false;
                if(Control.HasControls())
                {
                    foreach(Control child in Control.Controls)
                    {
                        if(Control.Footer == child)
                        {
                            RenderPager(writer);
                            pagerRendered = true;
                        }
                        child.RenderControl(writer);
                    }
                }
                if(!pagerRendered)
                {
                    RenderPager(writer);
                }
            }

            writer.ExitStyle(Style, false);

            if (formTagRequired)
            {
                if (!Device.SupportsQueryStringInFormAction)
                {
                    // Add query string parameters at the end of the form if
                    // there are any
                    RenderQueryParametersAsHiddenFields(writer);
                }
                writer.WriteEndTag("form");
            }
            writer.WriteEndTag("body");
        }