惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Hacker News: Front Page
博客园 - 【当耐特】
量子位
博客园 - 聂微东
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Register - Security
The Register - Security
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
Jina AI
Jina AI
The Cloudflare Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AWS News Blog
AWS News Blog
L
LINUX DO - 最新话题
酷 壳 – CoolShell
酷 壳 – CoolShell
The GitHub Blog
The GitHub Blog
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security @ Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Schneier on Security
Stack Overflow Blog
Stack Overflow Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Engineering at Meta
Engineering at Meta
W
WeLiveSecurity
博客园 - 三生石上(FineUI控件)
Security Archives - TechRepublic
Security Archives - TechRepublic
Hugging Face - Blog
Hugging Face - Blog
T
Troy Hunt's Blog
C
CERT Recently Published Vulnerability Notes
N
News and Events Feed by Topic
S
SegmentFault 最新的问题
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
人人都是产品经理
人人都是产品经理
SecWiki News
SecWiki News
N
News and Events Feed by Topic
C
Check Point Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
宝玉的分享
宝玉的分享
Schneier on Security
Schneier on Security
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
T
Threat Research - Cisco Blogs
J
Java Code Geeks

博客园 - 日月星尘

转:web开发注意事项 iframe动适应大小 - 日月星尘 - 博客园 C#中Datatable转Excel 为FreeTextBox添加中文字体 使用Asp.net MVC源代码调试你的应用程序 jquery插件,240个 30个流行的jQuery Plugins jQuery常用技巧 jquery表单验证插件 jquery.form.js 支持文件上传~ 超强1000个jquery极品插件! 生成静态页核心代码 asp.net提高网站性能的方法 25个基于浏览器的HTML在线编辑器集合 SQL Server动态为表添加字段的方法 c#对象初始化顺序 通过/PAE打开Windows 2003/2000的大内存支持 JavaScript 对象设计 ASP.net初学者常用知识 ASP.NET应用程序设计的10大技巧
用代码的方式生成Form并提交表单 - 日月星尘 - 博客园
日月星尘 · 2009-08-17 · via 博客园 - 日月星尘

Posted on 2009-08-17 17:09  日月星尘  阅读(383)  评论()    收藏  举报

 /// <summary>
        
/// 创建Form HTML代码
        
/// </summary>
        
/// <param name="parma">需要添加的参数</param>
        
/// <param name="url">网关的Url</param>
        protected string GetForm(Dictionary<stringstring> 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<stringstring> 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();
        }