public virtual void RenderPostBackHeader(HtmlMobileTextWriter writer, Form form) { bool postBack = form.Action.Length == 0; RenderPageState(writer); writer.WriteHiddenField(EventSourceKey, postBack ? "" : _postedFromOtherFile); writer.WriteHiddenField(EventArgumentKey, ""); RenderHiddenVariables(writer); writer.Write("<script language=javascript><!--\r\n"); writer.Write("function __doPostBack(target, argument){\r\n"); writer.Write(" var theform = document."); writer.Write(form.ClientID); writer.Write("\r\n"); if (form.Action.Length > 0) { writer.Write(" theform.action = \"\"\r\n"); } writer.Write(" theform."); writer.Write(EventSourceKey); writer.Write(".value = target\r\n"); writer.Write(" theform."); writer.Write(EventArgumentKey); writer.Write(".value = argument\r\n"); writer.Write(" theform.submit()\r\n"); writer.Write("}\r\n"); writer.Write("// -->\r\n"); writer.Write("</script>\r\n"); }
internal void RenderPageState(HtmlMobileTextWriter writer) { String viewState = Page.ClientViewState; if (viewState != null) { writer.WriteHiddenField(MobilePage.ViewStateID, viewState); } }
/// <include file='doc\ChtmlPageAdapter.uex' path='docs/doc[@for="ChtmlPageAdapter.RenderPostBackHeader"]/*' /> public override void RenderPostBackHeader(HtmlMobileTextWriter writer, Form form) { bool postBack = form.Action.Length == 0; RenderPageState(writer); if (!postBack) { writer.WriteHiddenField(EventSourceKey, _postedFromOtherFile); } else if (Page.ClientViewState == null) { // The empty event source variable is used to identify a // postback request writer.WriteHiddenField(EventSourceKey, String.Empty); } RenderHiddenVariables(writer); }
/// <include file='doc\HtmlTextBoxAdapter.uex' path='docs/doc[@for="HtmlTextBoxAdapter.RenderAsHiddenInputField"]/*' /> protected override void RenderAsHiddenInputField(HtmlMobileTextWriter 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 RenderQueryParametersAsHiddenFields( HtmlMobileTextWriter writer) { String action = Page.ActiveForm.Action; int indexOfQueryStringText = action.IndexOf('?'); if (indexOfQueryStringText != -1 || Page.QueryStringText != String.Empty || Control.Method == FormMethod.Get) { // We use __ufps as the delimiter in the collection. writer.WriteHiddenField( Constants.UniqueFilePathSuffixVariable.Substring( 0, Constants.UniqueFilePathSuffixVariable.Length - 1), String.Empty); String queryString; // If there is some query string on the Action attribute, // it takes the precedence. if (indexOfQueryStringText != -1) { queryString = action.Substring(indexOfQueryStringText + 1); } else { queryString = Page.QueryStringText; } if (queryString != null && queryString.Length != 0) { NameValueCollection collection = ParseQueryStringIntoCollection(queryString); for (int i = 0; i < collection.Count; i++) { writer.WriteHiddenField(collection.GetKey(i), collection.Get(i)); } } } }
protected void RenderHiddenVariables(HtmlMobileTextWriter 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\HtmlSelectionListAdapter.uex' path='docs/doc[@for="HtmlSelectionListAdapter.RenderAsHiddenInputField"]/*' /> protected override void RenderAsHiddenInputField(HtmlMobileTextWriter 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)); } } } }
/// <include file='doc\HtmlTextBoxAdapter.uex' path='docs/doc[@for="HtmlTextBoxAdapter.RenderAsHiddenInputField"]/*' /> protected override void RenderAsHiddenInputField(HtmlMobileTextWriter 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\HtmlSelectionListAdapter.uex' path='docs/doc[@for="HtmlSelectionListAdapter.RenderAsHiddenInputField"]/*' /> protected override void RenderAsHiddenInputField(HtmlMobileTextWriter 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)); } } } }