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

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

博客园 - Gary.han

移动端videojs视频插件使用直播流rtmp、hls、http-flv的注意事项 在Windows2008系统中利用IIS建立FTP服务器 TFS解决离职人员签出遗留签入的问题办法(转载) 金融行业的VC风险投资,PE私募股权,LP有限合伙人,GP普通合伙人 WCF数据传输配置文件参数的设置说明 C#操作Office文件,成功释放,但读取文件时提示"文件***正由另一进程使用,因此该进程无法访问此文件"的解决办法 解决MongoDB 日志文件过大,清理后还占用很大磁盘空间的问题 Windows硬盘映射网络磁盘目录,设置重启系统或开机后自动登录,保存用户名和密码 爬取网页时自动获取网页编码信息,并对特殊的乱码页面(压缩过的网页内容)用gzip进行解码。 HttpWebRequest.UserAgent 浏览器USER_AGENT留存 MongoDB的命令行语句,也可以引用插件LINQ的形式应用 SQL 配置选项 'Ad Hoc Distributed Queries' 不存在 SQL查询多个分类最新数据并求出较前一数据的变化 Linq对DataTable或者集合的排序,Where筛选,分组,统计总数sum等操作 Windows系统搜索功能提示"意外错误,操作无法完成"解决办法 JQuery Form AjaxSubmit(options)在Asp.net中的应用注意事项 安装EntityFramework(EFCodeFirst)遇到的问题(0X80004005)的解决办法 禁用文本框输入时的自动提示原来已输入过的内容 LINQ--联合查询表,按记录数分页读取数据
Jquery $.ajax方法使用示例
Gary.han · 2012-10-19 · via 博客园 - Gary.han

为避免ajax请求后返回整页的HTML源码,所以对Response值进行清空处理。

HttpContext.Current.Response.Clear();

HttpContext.Current.Response.Write("[{sname:\"" + strSName + "\",fname:\"" + strFName + "\"}]");

HttpContext.Current.Response.End(); 

//HTML前端 

function SearchCorpInfo() {
            //debugger;
            $.ajax({
                type: "POST",
                url: "ManageCorpInfo.aspx?Mode=GetCorpInfo&Code=" + $("#stockID_").val(),
                success: function(msg) {
                    if (msg != "异常") {
                        var dt = eval(msg);
                        if (dt != null && dt != NaN) {
                            $.each(dt, function(kk, vv) {
                                var SimpleName = vv["sname"];
                                var FullName = vv["fname"];

                                $("#txtSimpleName").val(SimpleName);
                                $("#txtCorpName").val(FullName);
                            });

                        }
                    }
                    else {
                        $("#txtSimpleName").val("");
                        $("#txtCorpName").val("");
                    }
                },
                error: function() {
                }
            });
        } 

 //后台代码端Load事件

if (Request.QueryString["Mode"] != null)
            {
                if ("GetCorpInfo" == Request.QueryString["Mode"].ToString())
                {
                    if (Request.QueryString["Code"] != null)
                    {
                        if (Request.QueryString["Code"].ToString().Length == 6)
                            SearchCorpInfo(Request.QueryString["Code"].ToString());
                    }
                }
            }

//根据录入的公司代码获得公司简称和全称
        public void SearchCorpInfo(string corpCode)
        {
            //获取公司名称
            CorpInfoManageDB objC = new CorpInfoManageDB();
            DataTable dtCorp = objC.CompanyInfo_GetInfo(corpCode, ""0);
            if (objC.ErrorMsg.Length > 0)
            {
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Write("异常");
                HttpContext.Current.Response.End();
            }
            if (dtCorp.Rows.Count == 0)
            {
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Write("异常");
                HttpContext.Current.Response.End();
            }
            string strSName = dtCorp.Rows[0]["SimpleName"].ToString();
            string strFName = dtCorp.Rows[0]["CorpName"].ToString();
            HttpContext.Current.Response.Clear();

            HttpContext.Current.Response.Write("[{sname:\"" + strSName + "\",fname:\"" + strFName + "\"}]");
            HttpContext.Current.Response.End();
        }