public static string BuildFormHtml(SortedDictionary<string, string> sParaTemp, string gateway, string strMethod, string strButtonValue)
        {


            StringBuilder sbHtml = new StringBuilder();

            sbHtml.Append("<form id='Buildform1' name='Buildform1' action='" + gateway + "' method='" + strMethod.ToLower().Trim() + "'>");

            foreach (KeyValuePair<string, string> temp in sParaTemp)
            {
                sbHtml.Append("<input type='hidden' name='" + temp.Key + "' value='" + temp.Value + "'/>");
            }

            //submit按钮控件请不要含有name属性
            sbHtml.Append("<input type='submit' value='" + strButtonValue + "' style='display:none;'></form>");

            sbHtml.Append("<script>document.forms['Buildform1'].submit();</script>");
            return sbHtml.ToString();
        }
            //待请求参数数组
            SortedDictionary<string, string> dicPara = new SortedDictionary<string, string>();
            dicPara.Add("userName", userNo);
            string html = BuildFormHtml(dicPara, "passBackDo.aspx", "post", "下一步");
            Response.Write(html);

相关文章:

  • 2022-12-23
  • 2021-12-11
  • 2021-04-18
  • 2021-04-11
  • 2021-12-18
  • 2022-01-23
猜你喜欢
  • 2021-11-09
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-07-12
相关资源
相似解决方案