/// <summary>
/// 创建Form HTML代码
/// </summary>
/// <param name="parma">需要添加的参数</param>
/// <param name="url">网关的Url</param>
protected string GetForm(Dictionary<string, string> parma, string url)
{
string formItem = "<input type='hidden' name='{0}' value='{1}'>";
StringBuilder html = new StringBuilder();
html.AppendLine("<form name='Gateway' method='post'" + " action =" + url + ">");
foreach (KeyValuePair<string, string> item in parma)
{
html.AppendLine(string.Format(formItem, item.Key, item.Value));
}
html.AppendLine("<input type='submit'id='submit' value='提交' style='display:none'/>");
html.AppendLine("</form>");
//html.AppendLine("<script type='text/javascript'>window.document.Gateway.submit();</script>");
html.AppendLine("<script type='text/javascript'>window.document.getElementById('submit').click();</script>");
return html.ToString();
}
/// 创建Form HTML代码
/// </summary>
/// <param name="parma">需要添加的参数</param>
/// <param name="url">网关的Url</param>
protected string GetForm(Dictionary<string, string> parma, string url)
{
string formItem = "<input type='hidden' name='{0}' value='{1}'>";
StringBuilder html = new StringBuilder();
html.AppendLine("<form name='Gateway' method='post'" + " action =" + url + ">");
foreach (KeyValuePair<string, string> item in parma)
{
html.AppendLine(string.Format(formItem, item.Key, item.Value));
}
html.AppendLine("<input type='submit'id='submit' value='提交' style='display:none'/>");
html.AppendLine("</form>");
//html.AppendLine("<script type='text/javascript'>window.document.Gateway.submit();</script>");
html.AppendLine("<script type='text/javascript'>window.document.getElementById('submit').click();</script>");
return html.ToString();
}
浙公网安备 33010602011771号