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

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

博客园 - 小二哥

Linq To SQL 针对单张表,有关系的2张表做查询 请问:MOSS使用中机器名与IP地址的问题 MOSS: 如何根据AD帐号判断该用户是否属于网站用户? 在SQL数据库中构造树,直接显示在.Net的DropDownList里 今天解决了K2工作流的,会签与并签问题 钱额的大小写转换的JS代码 郁闷了半个下午的javascript 滑动条的风格控制 DropDownList的SelectedValue和SelectedIndex asp.net页面的Page_Load执行两次 分析器错误:访问被拒绝....... 论坛登录页面 iframe自适应问题 今天遇到的几个问题以及解决方法 K2自定义工作流程 .Net中几个容易混淆的概念 郁闷到极点了,VSTO2005问题 ajax实现无刷新两级联动DropDownList 如何从XML字符串获取DataSet
Ajax的简单配置与应用.
小二哥 · 2006-04-16 · via 博客园 - 小二哥

刚看了小山的blog,里面有一篇关于Ajax的初步使用,按其步骤做了一下:

1.

引用ajax.dll
    将ajax.dll拷贝到项目bin目录中,同时增加对它的引用.

2.

修改web.config文件.
   在web.config中增加如下节点.
   <httpHandlers>
  
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" />
</httpHandlers>3. 书写ajax方法.
     ajax方法与一般的方法基本相同,只是在前面增加一个: [Ajax.AjaxMethod]
    为方便起见,增加一个类文件,暂起名为: AjaxMethod.cs
    例如:
    [Ajax.AjaxMethod]
    public static string GetNIVNumber(string str)
    {
         return str;
    }
4. 书写javascript
    为方便起见,书写一个.js文件,暂起名为: AjaxJScript.js
    在此文件内增加需要的函数.例如:
   /* FirstAjaxSample所使用到的函数 */
   function testAjax(owner, item, evt)
  {
   var first=document.getElementById("txtfirst");
   AjaxMethod.GetNIVNumber(first.value,callback_GetNIVNumber);
   }
  function callback_GetNIVNumber(res)
  {
   var obj=document.getElementById("txtsecond");  
   obj.value=res.value;   
  }

5. 修改.aspx页面 
    在页面的前台代码中,增加对.js文件的引用.
    <script language="javascript" src="AjaxJScript.js"></script>
    Page_Load中注册(其中MyAjaxSample为AjaxMethod类所在的命名空间):
    Ajax.Utility.RegisterTypeForAjax(typeof(MyAjaxSample.AjaxMethod)); 运行即可看到效果.在第一个textbox中输入内容,点击button,就把内容显示到第二textbox中.