private void btnOk_Click(object sender, EventArgs e)
 {
     try
     {
         string       name   = this.FormName;
         string       action = this.FormAction;
         SubmitMethod method = this.FormMethod;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         this.DialogResult = DialogResult.None;
     }
 }
        /// <summary>
        /// Inserts a new input form
        /// </summary>
        /// <param name="formName">The name of the form</param>
        /// <param name="action">The action attribute</param>
        /// <param name="method">The submitting method</param>
        public void InsertForm(string formName, string action, SubmitMethod method)
        {
            IHTMLTxtRange range = this.document.selection.createRange() as IHTMLTxtRange;

            string submitMethod = string.Empty;

            switch (method)
            {
            case SubmitMethod.Get:
                submitMethod = "get";
                break;

            case SubmitMethod.Post:
                submitMethod = "post";
                break;
            }

            range.pasteHTML("<form name=\"" + formName + "\" action=\"" + action +
                            "\" method=\"" + submitMethod + "\"></form>");
        }
示例#3
0
 public static IWriter2 <T, FormContent <TModel> > Method <T, TModel>(this IWriter2 <T, FormContent <TModel> > target, SubmitMethod value)
     where T : Form <TModel>
 {
     target.Item.MethodValue = value;
     return(target);
 }
        /// <summary>
        /// Inserts a new input form
        /// </summary>
        /// <param name="formName">The name of the form</param>
        /// <param name="action">The action attribute</param>
        /// <param name="method">The submitting method</param>
        public void InsertForm(string formName, string action, SubmitMethod method)
        {
            IHTMLTxtRange range = this.document.selection.createRange() as IHTMLTxtRange;

            string submitMethod = string.Empty;
            switch (method)
            {
                case SubmitMethod.Get:
                    submitMethod = "get";
                    break;

                case SubmitMethod.Post:
                    submitMethod = "post";
                    break;
            }

            range.pasteHTML("<form name=\"" + formName + "\" action=\"" + action +
                "\" method=\"" + submitMethod + "\"></form>");
        }