private void RenderPostBackHeader(XhtmlMobileTextWriter writer)
        {
            bool postBack = Page.ActiveForm.Action.Length == 0;

            RenderPageState(writer);
            if (!postBack)
            {
                writer.WriteHiddenField(PageAdapter.EventSourceKey, XhtmlConstants.PostedFromOtherFile);
            }
            else if (Page.ClientViewState == null)
            {
                // The empty event source variable is used to identify a
                // postback request.  Value attribute is not needed, and some
                // devices do not allow empty string value attributes.
                if ((String)Device["requiresHiddenFieldValues"] != "true")
                {
                    writer.WriteHiddenField(PageAdapter.EventSourceKey);
                }
                else
                {
                    // Placeholder value is never used, just needed for some devices.
                    writer.WriteHiddenField(PageAdapter.EventSourceKey, PageAdapter.EventSourceKey);
                }
            }

            RenderHiddenVariables(writer);
        }
        private void RenderPageState(XhtmlMobileTextWriter writer)
        {
            String viewState = Page.ClientViewState;

            if (viewState != null)
            {
                writer.WriteHiddenField(MobilePage.ViewStateID, viewState);
            }
        }
Пример #3
0
        /// <include file='doc\XhtmlBasicTextBoxAdapter.uex' path='docs/doc[@for="XhtmlTextBoxAdapter.RenderAsHiddenInputField"]/*' />
        protected override void RenderAsHiddenInputField(XhtmlMobileTextWriter writer)
        {
            // Optimization - if viewstate is enabled for this control, and the
            // postback returns to this page, we just let it do the trick.

            if (Control.Form.Action.Length > 0 || (!IsViewStateEnabled() && Control.Text != _staticValue))
            {
                writer.WriteHiddenField(Control.UniqueID, Control.Text);
            }
        }
 private void RenderHiddenVariables(XhtmlMobileTextWriter writer)
 {
     if (Page.HasHiddenVariables())
     {
         String hiddenVariablePrefix = MobilePage.HiddenVariablePrefix;
         foreach (DictionaryEntry entry in Page.HiddenVariables)
         {
             if (entry.Value != null)
             {
                 writer.WriteHiddenField(hiddenVariablePrefix + (String)entry.Key,
                                         (String)entry.Value);
             }
         }
     }
 }
        /// <include file='doc\XhtmlBasicSelectionListAdapter.uex' path='docs/doc[@for="XhtmlSelectionListAdapter.RenderAsHiddenInputField"]/*' />
        protected override void RenderAsHiddenInputField(XhtmlMobileTextWriter writer)
        {
            // Optimization - if viewstate is enabled for this control, and the
            // postback returns to this page, we just let it do the trick.
            // One catch though - if the control is multiselect, it always
            // interprets return values, so we do need to write out.

            if (Control.IsMultiSelect || Control.Form.Action.Length > 0 || !IsViewStateEnabled())
            {
                String uniqueID = Control.UniqueID;
                MobileListItemCollection items = Control.Items;
                for (int i = 0; i < items.Count; i++)
                {
                    if (items[i].Selected)
                    {
                        writer.WriteHiddenField(uniqueID, i.ToString(CultureInfo.InvariantCulture));
                    }
                }
            }
        }
 private void RenderPageState (XhtmlMobileTextWriter writer) {
     String viewState = Page.ClientViewState;
     if (viewState != null) {
         writer.WriteHiddenField (MobilePage.ViewStateID, viewState);
     }
 }
 private void RenderHiddenVariables(XhtmlMobileTextWriter writer) {
     if (Page.HasHiddenVariables()) {
         String hiddenVariablePrefix = MobilePage.HiddenVariablePrefix;
         foreach (DictionaryEntry entry in Page.HiddenVariables) {
             if (entry.Value != null) {
                 writer.WriteHiddenField(hiddenVariablePrefix + (String)entry.Key, 
                     (String)entry.Value);
             }
         }
     }
 }
        private void RenderPostBackHeader(XhtmlMobileTextWriter writer) {
            bool postBack = Page.ActiveForm.Action.Length == 0;

            RenderPageState(writer);
            if (!postBack) {
                writer.WriteHiddenField(PageAdapter.EventSourceKey, XhtmlConstants.PostedFromOtherFile);
            }
            else if (Page.ClientViewState == null) {
                // The empty event source variable is used to identify a
                // postback request.  Value attribute is not needed, and some
                // devices do not allow empty string value attributes.
                if ((String)Device["requiresHiddenFieldValues"] != "true") {
                    writer.WriteHiddenField(PageAdapter.EventSourceKey);
                }
                else {
                    // Placeholder value is never used, just needed for some devices.
                    writer.WriteHiddenField(PageAdapter.EventSourceKey, PageAdapter.EventSourceKey);
                }
            }

            RenderHiddenVariables(writer);
        }
        /// <include file='doc\XhtmlBasicTextBoxAdapter.uex' path='docs/doc[@for="XhtmlTextBoxAdapter.RenderAsHiddenInputField"]/*' />
        protected override void RenderAsHiddenInputField(XhtmlMobileTextWriter writer) {
            // Optimization - if viewstate is enabled for this control, and the
            // postback returns to this page, we just let it do the trick.

            if (Control.Form.Action.Length > 0 || (!IsViewStateEnabled() && Control.Text != _staticValue)) {
                writer.WriteHiddenField(Control.UniqueID, Control.Text);
            }
        }
        /// <include file='doc\XhtmlBasicSelectionListAdapter.uex' path='docs/doc[@for="XhtmlSelectionListAdapter.RenderAsHiddenInputField"]/*' />
        protected override void RenderAsHiddenInputField(XhtmlMobileTextWriter writer) {
            // Optimization - if viewstate is enabled for this control, and the
            // postback returns to this page, we just let it do the trick.
            // One catch though - if the control is multiselect, it always 
            // interprets return values, so we do need to write out.

            if (Control.IsMultiSelect || Control.Form.Action.Length > 0 || !IsViewStateEnabled()) {
                String uniqueID = Control.UniqueID;
                MobileListItemCollection items = Control.Items;
                for (int i = 0; i < items.Count; i++) {
                    if (items[i].Selected) {
                        writer.WriteHiddenField(uniqueID, i.ToString(CultureInfo.InvariantCulture));
                    }
                }
            }
        }