// 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();
     }
 }
Exemple #2
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();
            }
        }