public virtual void RenderSelectOptionAsPostBack(WmlTextWriter writer, string text, String target, String argument) { if (writer.AnalyzeMode) { return; } writer.WriteFullBeginTag("option"); writer.WriteBeginTag("onevent"); writer.WriteAttribute("type", "onpick"); writer.Write(">"); writer.WriteBeginTag("go"); writer.WriteAttribute("href", "#" + WmlTextWriter.PostBackWithVarsCardID); writer.Write(">"); if (!String.IsNullOrEmpty(target)) { writer.WriteBeginTag("setvar"); writer.WriteAttribute("name", _postBackEventTargetVarName); writer.WriteAttribute("value", target); writer.Write(" />"); } if (!String.IsNullOrEmpty(argument)) { writer.WriteBeginTag("setvar"); writer.WriteAttribute("name", _postBackEventArgumentVarName); writer.WriteAttribute("value", argument); writer.Write(" />"); } writer.WriteEndTag("go"); writer.WriteEndTag("onevent"); writer.WriteEncodedText(text); writer.WriteEndTag("option"); _writtenPostBack = true; _usePostBackCards = true; }
private void RenderGoActionToPostbackCard(WmlTextWriter writer, String target, String argument, String postUrl) { // If using postback cards, render a go action to the given // postback card, along with setvars setting the target and // argument. writer.WriteBeginTag("go"); writer.Write(" href=\""); _writtenPostBack = true; writer.Write("#"); writer.Write(WmlTextWriter.PostBackWithVarsCardID); writer.Write("\">"); writer.WriteBeginTag("setvar"); writer.WriteAttribute("name", _postBackEventTargetVarName); writer.WriteAttribute("value", target); writer.Write("/>"); writer.WriteBeginTag("setvar"); writer.WriteAttribute("name", _postBackEventArgumentVarName); writer.Write(" value=\""); if (argument != null) { writer.WriteEncodedText(argument); } writer.Write("\"/>"); if (!String.IsNullOrEmpty(postUrl)) { writer.WriteBeginTag("setvar"); writer.WriteAttribute("name", _postUrlVarName); writer.Write(" value=\""); writer.WriteEncodedUrl(postUrl); writer.Write("\"/>"); } writer.WriteEndTag("go"); }
protected internal override void Render(HtmlTextWriter writer) { WmlTextWriter wmlWriter = (WmlTextWriter)writer; if (Page.Form == null) { throw new HttpException(SR.GetString(SR.PageAdapter_MustHaveFormRunatServer)); } if (Page.HasRenderDelegate()) { throw new HttpException(SR.GetString(SR.PageAdapter_RenderDelegateMustBeInServerForm)); } if (RequiresUTF8ContentEncoding()) { Page.Response.ContentEncoding = _utf8Encoding; } InitializeWriter(wmlWriter); RenderXmlHeader(wmlWriter); wmlWriter.WriteFullBeginTag("wml"); RenderCacheExpiry(wmlWriter); HtmlForm form = Page.Form; AnalyzeAndRenderHtmlForm(wmlWriter, form); RenderPostBackCard(wmlWriter); wmlWriter.WriteEndTag("wml"); }
// Renders the end of the form. protected internal virtual void RenderEndForm(WmlTextWriter writer) { writer.CloseParagraph(); writer.Indent--; writer.WriteEndTag("card"); writer.WriteLine(); }
public override void RenderEndHyperlink(HtmlTextWriter writer) { WmlTextWriter wmlWriter = (WmlTextWriter)writer; if (wmlWriter.AnalyzeMode) { return; } wmlWriter.WriteEndTag("a"); }
// Render a select option. public virtual void RenderSelectOption(WmlTextWriter writer, string text) { if (writer.AnalyzeMode) { return; } writer.WriteFullBeginTag("option"); writer.WriteEncodedText(text); writer.WriteEndTag("option"); }
public virtual void RenderSelectOption(WmlTextWriter writer, String text, String value) { if (writer.AnalyzeMode) { return; } writer.WriteBeginTag("option"); writer.WriteAttribute("value", value, true); writer.Write(">"); writer.WriteEncodedText(text); writer.WriteEndTag("option"); }
public virtual void RenderSelectOptionWithNavigateUrl(WmlTextWriter writer, String text, string navigateUrl) { if (writer.AnalyzeMode) { return; } writer.WriteBeginTag("option"); writer.WriteAttribute("onpick", navigateUrl); writer.Write(">"); writer.WriteEncodedText(text); writer.WriteEndTag("option"); }
public virtual void RenderEndPostBack(WmlTextWriter writer, String target, String argument, String postUrl) { if (writer.AnalyzeMode) { // Analyze postbacks to see if postback cards should // be rendered. AnalyzePostBack(WmlPostFieldType.Submit); } else { RenderGoAction(writer, target, argument, postUrl); writer.WriteEndTag("anchor"); } }
public void RenderSelectOptionAsAutoPostBack(WmlTextWriter writer, string text, string groupName, string value) { if (writer.AnalyzeMode) { return; } writer.WriteFullBeginTag("option"); writer.WriteBeginTag("onevent"); writer.WriteAttribute("type", "onpick"); writer.Write(">"); writer.WriteBeginTag("go"); writer.WriteAttribute("href", "#" + WmlTextWriter.PostBackWithVarsCardID); writer.Write(">"); writer.WriteBeginTag("setvar"); writer.WriteAttribute("name", writer.MapClientIDToShortName(groupName, false)); writer.WriteAttribute("value", value); writer.Write(" />"); writer.WriteEndTag("go"); writer.WriteEndTag("onevent"); writer.WriteEncodedText(text); writer.WriteEndTag("option"); _writtenPostBack = true; _usePostBackCards = true; }
public void RenderSelectOptionAsAutoPostBack(WmlTextWriter writer, string text, string value) { if (writer.AnalyzeMode) { return; } writer.WriteBeginTag("option"); if (!String.IsNullOrEmpty(value)) { writer.WriteAttribute("value", value, true); } writer.WriteAttribute("onpick", "#" + WmlTextWriter.PostBackWithVarsCardID); writer.Write(">"); writer.WriteEncodedText(text); writer.WriteEndTag("option"); // force use of postback cards with variables. _writtenPostBack = true; _usePostBackCards = true; }
// Render a complete form post in a go action. This is used when rendering a postback card, or when // rendering a go action that posts back directly rather than redirecting to a postback card. private void RenderFormPostInGoAction(WmlTextWriter writer, string target, string argument, WmlPostFieldType postFieldType, String postUrl) { writer.WriteBeginTag("go"); writer.Write(" href=\""); if (!Page.ContainsCrossPagePost) { RenderPostBackUrl(writer, Page.RelativeFilePath); RenderFormQueryString(writer, QueryString); } else if (!String.IsNullOrEmpty(postUrl)) { RenderPostBackUrl(writer, postUrl); } else { writer.Write("$("); writer.Write(_postUrlVarName); if (!StringUtil.EqualsIgnoreCase((string)Browser["requiresNoescapedPostUrl"], "false")) { writer.Write(":noescape"); } writer.Write(")"); } writer.Write("\""); string method = Page.Form.Method; RenderFormMethodAttribute(writer, method); writer.Write(">"); string clientState = ClientState; if (clientState != null) { ICollection stateChunks = Page.DecomposeViewStateIntoChunks(); int numChunks = stateChunks.Count; if (numChunks > 1) { RenderStatePostField(writer, Page.ViewStateFieldCountID, stateChunks.Count.ToString(CultureInfo.CurrentCulture)); } int count = 0; foreach (String state in stateChunks) { string key = Page.ViewStateFieldPrefixID; if (count > 0 ) { key += count.ToString(CultureInfo.CurrentCulture); } RenderStatePostField(writer, key, state); ++count; } } RenderReferrerPagePostField(writer); RenderTargetAndArgumentPostFields(writer, target, argument, postFieldType); RenderPostFieldVariableDictionary(writer, _dynamicPostFields); RenderPostFieldDictionary(writer, _staticPostFields); // writer.WriteEndTag("go"); }
// Render a complete form post in a go action. This is used when rendering a postback card, or when // rendering a go action that posts back directly rather than redirecting to a postback card. private void RenderFormPostInGoAction(WmlTextWriter writer, string target, string argument, WmlPostFieldType postFieldType, String postUrl) { writer.WriteBeginTag("go"); writer.Write(" href=\""); if (!Page.ContainsCrossPagePost) { RenderPostBackUrl(writer, Page.RelativeFilePath); RenderFormQueryString(writer, QueryString); } else if (!String.IsNullOrEmpty(postUrl)) { RenderPostBackUrl(writer, postUrl); } else { writer.Write("$("); writer.Write(_postUrlVarName); if (!StringUtil.EqualsIgnoreCase((string)Browser["requiresNoescapedPostUrl"], "false")) { writer.Write(":noescape"); } writer.Write(")"); } writer.Write("\""); string method = Page.Form.Method; RenderFormMethodAttribute(writer, method); writer.Write(">"); string clientState = ClientState; if (clientState != null) { ICollection stateChunks = Page.DecomposeViewStateIntoChunks(); int numChunks = stateChunks.Count; if (numChunks > 1) { RenderStatePostField(writer, Page.ViewStateFieldCountID, stateChunks.Count.ToString(CultureInfo.CurrentCulture)); } int count = 0; foreach (String state in stateChunks) { string key = Page.ViewStateFieldPrefixID; if (count > 0) { key += count.ToString(CultureInfo.CurrentCulture); } RenderStatePostField(writer, key, state); ++count; } } RenderReferrerPagePostField(writer); RenderTargetAndArgumentPostFields(writer, target, argument, postFieldType); RenderPostFieldVariableDictionary(writer, _dynamicPostFields); RenderPostFieldDictionary(writer, _staticPostFields); // writer.WriteEndTag("go"); }