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");
        }
 // Renders the TextBox.
 public virtual void RenderTextBox(WmlTextWriter writer, String id, String value, String format, String title, bool password, int size, int maxLength, bool generateRandomID) {
     if (!writer.AnalyzeMode) {
         // 
                         
         // VSWhidbey 147458.  Close any style tags.
         writer.CloseCurrentStyleTags();
         writer.WriteBeginTag("input");
         // Map the client ID to a short name. See
         // MapClientIDToShortName for details.
         writer.WriteAttribute("name", writer.MapClientIDToShortName(id, generateRandomID));
         if (password) {
             writer.WriteAttribute("type", "password");
         }
         if (!String.IsNullOrEmpty(format)) {
             writer.WriteAttribute("format", format);
         }
         if (!String.IsNullOrEmpty(title)) {
             writer.WriteAttribute("title", title, true);
         }
         if (size > 0) {
             writer.WriteAttribute("size", size.ToString(CultureInfo.InvariantCulture));
         }
         if (maxLength > 0) {
             writer.WriteAttribute("maxlength", maxLength.ToString(CultureInfo.InvariantCulture));
         }
         // We do not need a value attribute.  The Text value is populated by the client side var set in onenterforward.
         writer.WriteLine(" />");
         writer.OpenCurrentStyleTags();
     }
 }
 private void RenderSetFormVariables(WmlTextWriter writer)
 {
     foreach (DictionaryEntry entry in _formVariables)
     {
         writer.WriteBeginTag("setvar");
         writer.WriteAttribute("name", (String)entry.Key);
         writer.WriteAttribute("value", (String)entry.Value, true);
         writer.Write(" />");
     }
 }
 private void RenderPostUrlFormVariable(WmlTextWriter writer)
 {
     if (Page.ContainsCrossPagePost)
     {
         writer.WriteBeginTag("setvar");
         writer.WriteAttribute("name", _postUrlVarName);
         writer.Write(" value=\"");
         RenderPostBackUrl(writer, Page.RelativeFilePath);
         RenderFormQueryString(writer, QueryString);
         writer.Write("\" />");
     }
 }
        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 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;
 }
        //     Renders postback cards.
        private void RenderPostBackCard(WmlTextWriter writer)
        {
            if (!_writtenPostBack)
            {
                return;
            }

            writer.WriteBeginTag("card");
            writer.WriteAttribute("id", WmlTextWriter.PostBackWithVarsCardID);
            writer.WriteLine(">");

            writer.Write("<onevent type=\"onenterforward\">");
            RenderFormPostInGoAction(writer, null, _postBackEventArgumentVarName, WmlPostFieldType.Variable, String.Empty);
            //
            writer.WriteLine("</onevent>");

            writer.WriteLine("<onevent type=\"onenterbackward\"><prev /></onevent>");
            writer.WriteLine("</card>");
        }
        public virtual void RenderBeginPostBack(WmlTextWriter writer, string softkeyLabel, string accessKey)
        {
            if (writer.AnalyzeMode)
            {
                return;
            }

            // If the softkey label is too long, let the device choose a default softkey label.
            softkeyLabel = ResolveSoftkeyLabel(softkeyLabel);
            writer.WriteBeginTag("anchor");
            if (softkeyLabel != null && softkeyLabel.Length > 0 && !RequiresNoSoftkeyLabels)
            {
                writer.WriteAttribute("title", softkeyLabel, false /* encode Whidbey 17925 */);
            }
            if (accessKey != null && accessKey.Length > 0 && DoesBrowserSupportAccessKey())
            {
                writer.WriteAttribute("accessKey", accessKey);
            }
            writer.Write(">");
        }
        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;
        }
        public override void RenderBeginHyperlink(HtmlTextWriter writer, string targetUrl, bool encodeUrl, string softkeyLabel, string accessKey)
        {
            WmlTextWriter wmlWriter = (WmlTextWriter)writer;

            if (wmlWriter.AnalyzeMode)
            {
                return;
            }

            // Valid values are null, String.Empty, and single character strings
            if ((accessKey != null) && (accessKey.Length > 1))
            {
                throw new ArgumentOutOfRangeException("accessKey");
            }

            // If the softkey label is too long, let the device choose a default softkey label.
            softkeyLabel = ResolveSoftkeyLabel(softkeyLabel);
            wmlWriter.WriteBeginTag("a");
            wmlWriter.Write(" href=\"");
            if (encodeUrl)
            {
                targetUrl = targetUrl.Replace("$", "$$");
                targetUrl = HttpUtility.HtmlAttributeEncode(targetUrl); // Leaves "$" alone.
                wmlWriter.Write(targetUrl);
            }
            else
            {
                wmlWriter.Write(wmlWriter.EscapeAmpersand(targetUrl));
            }
            wmlWriter.Write("\"");
            if (softkeyLabel != null && softkeyLabel.Length > 0 && !RequiresNoSoftkeyLabels)
            {
                wmlWriter.WriteAttribute("title", softkeyLabel, false /* encode */);
            }
            if (accessKey != null && accessKey.Length > 0 && DoesBrowserSupportAccessKey())
            {
                wmlWriter.WriteAttribute("accessKey", accessKey, false /* encode */);
            }
            wmlWriter.Write(">");
        }
Ejemplo n.º 13
0
        // Renders the TextBox.
        public virtual void RenderTextBox(WmlTextWriter writer, String id, String value, String format, String title, bool password, int size, int maxLength, bool generateRandomID)
        {
            if (!writer.AnalyzeMode)
            {
                //

                // VSWhidbey 147458.  Close any style tags.
                writer.CloseCurrentStyleTags();
                writer.WriteBeginTag("input");
                // Map the client ID to a short name. See
                // MapClientIDToShortName for details.
                writer.WriteAttribute("name", writer.MapClientIDToShortName(id, generateRandomID));
                if (password)
                {
                    writer.WriteAttribute("type", "password");
                }
                if (!String.IsNullOrEmpty(format))
                {
                    writer.WriteAttribute("format", format);
                }
                if (!String.IsNullOrEmpty(title))
                {
                    writer.WriteAttribute("title", title, true);
                }
                if (size > 0)
                {
                    writer.WriteAttribute("size", size.ToString(CultureInfo.InvariantCulture));
                }
                if (maxLength > 0)
                {
                    writer.WriteAttribute("maxlength", maxLength.ToString(CultureInfo.InvariantCulture));
                }
                // We do not need a value attribute.  The Text value is populated by the client side var set in onenterforward.
                writer.WriteLine(" />");
                writer.OpenCurrentStyleTags();
            }
        }
Ejemplo n.º 14
0
        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");
        }
Ejemplo n.º 15
0
        //     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");
        }
Ejemplo n.º 16
0
        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;
        }
Ejemplo n.º 17
0
 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;
 }
Ejemplo n.º 18
0
        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;
        }
Ejemplo n.º 19
0
        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");
        }
Ejemplo n.º 20
0
        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");
        }
Ejemplo n.º 21
0
        public virtual void RenderBeginPostBack(WmlTextWriter writer, string softkeyLabel, string accessKey) {
            if (writer.AnalyzeMode) {
                return;
            }

            // If the softkey label is too long, let the device choose a default softkey label.
            softkeyLabel = ResolveSoftkeyLabel(softkeyLabel);
            writer.WriteBeginTag("anchor");
            if (softkeyLabel != null && softkeyLabel.Length > 0 && !RequiresNoSoftkeyLabels)
                writer.WriteAttribute("title", softkeyLabel, false /* encode Whidbey 17925 */);
            if (accessKey != null && accessKey.Length > 0 && DoesBrowserSupportAccessKey())
                writer.WriteAttribute("accessKey", accessKey);
            writer.Write(">");
        }
Ejemplo n.º 22
0
 private void RenderPostUrlFormVariable(WmlTextWriter writer) {
     if (Page.ContainsCrossPagePost) {
         writer.WriteBeginTag("setvar");
         writer.WriteAttribute("name", _postUrlVarName);
         writer.Write(" value=\"");
         RenderPostBackUrl(writer, Page.RelativeFilePath);
         RenderFormQueryString(writer, QueryString);
         writer.Write("\" />");
     }
 }
Ejemplo n.º 23
0
 private void RenderSetFormVariables(WmlTextWriter writer) {
     foreach (DictionaryEntry entry in _formVariables) {
         writer.WriteBeginTag("setvar");
         writer.WriteAttribute("name", (String)entry.Key);
         writer.WriteAttribute("value", (String)entry.Value, true);
         writer.Write(" />");
     }
 }
        //     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");
        }
Ejemplo n.º 25
0
        //     Renders postback cards.
        private void RenderPostBackCard(WmlTextWriter writer) {
            if (!_writtenPostBack) {
                return;
            }

            writer.WriteBeginTag("card");
            writer.WriteAttribute("id", WmlTextWriter.PostBackWithVarsCardID);
            writer.WriteLine(">");

            writer.Write("<onevent type=\"onenterforward\">");
            RenderFormPostInGoAction(writer, null, _postBackEventArgumentVarName, WmlPostFieldType.Variable, String.Empty);
            // 
            writer.WriteLine("</onevent>");

            writer.WriteLine("<onevent type=\"onenterbackward\"><prev /></onevent>");
            writer.WriteLine("</card>");
        }