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 = 'den den 'name = '" + temp. key + "'value = '" + temp. value + "'/>");} // do not include the name attribute sbHtml in the submit button control. 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 "," Next "); Response. write (html );