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

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Google DeepMind News
Google DeepMind News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
U
Unit 42
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
G
Google Developers Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
Jina AI
Jina AI
量子位
宝玉的分享
宝玉的分享
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 聂微东
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
美团技术团队
The Hacker News
The Hacker News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tailwind CSS Blog
博客园 - 司徒正美
博客园 - 叶小钗
Hugging Face - Blog
Hugging Face - Blog
P
Palo Alto Networks Blog
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Forbes - Security
Forbes - Security
Attack and Defense Labs
Attack and Defense Labs
Google DeepMind News
Google DeepMind News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
P
Privacy International News Feed
G
GRAHAM CLULEY
The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
AI
AI
V2EX - 技术
V2EX - 技术

博客园 - lrary

JavaScript经典技巧 - lrary - 博客园 动态添加ASP.NET控件并绑定处理事件一例 - lrary - 博客园 脚本收藏 - lrary - 博客园 一些sql语句的详细解释[转] 特殊的DataGrid的绑定 - lrary - 博客园 纯脚本搞掂DataGrid表表头不动,表身滚动。(转摘) - lrary - 博客园 检验密码强度的JS类 - lrary - 博客园 数据库设计规范 V2.0 SQL语句特---殊统计(1) DataGrid 多行 DataGrid怎么产生一个分类的题头 sql怎么使用外连接 Asp.NET程序中常用的三十三种代码 检测含有中文字符串的实际长度 根据区位得到汉字拼音首字母(c#) 认识ASP.NET配置文件Web.config Asp.net(C#)实现验证码功能 给Repeater、Datalist和Datagrid增加自动编号列 查找和统计页面上控件
AJAX 在.net的应用
lrary · 2006-05-09 · via 博客园 - lrary

先配置webconfig,如下:

 1<configuration>
 2  <appSettings>
 3    <add key="ConnectionString" value="workstation id=(local);packet size=4096;user id=sa;data source=(local);persist security info=True;initial catalog=ckgl;password=sa" />
 4      </appSettings>
 5  <system.web>
 6<httpHandlers>
 7<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro" />
 8</httpHandlers>
 9 .
10.
11.
12</system.web>
13</configuration>
14

然后在Global.asax添加下面的内容

1protected void Application_Start(Object sender, EventArgs e)
2        {
3            AjaxPro.Utility.HandlerPath = "ajaxpro";
4        }

怎么在代码里调用呢,这里很关键,先在后台代码Page_Load里添加:

private void Page_Load(object sender, System.EventArgs e)
        
{
AjaxPro.Utility.RegisterTypeForAjax(
typeof(func.GetMaxId));
}

下面举个简单的例子:
后台代码

 1[AjaxPro.AjaxMethod]
 2        public string Get_lsbm(string dlbm,string xlbm)
 3        {
 4            string StrSql =@"select str(max(cast(lsbm as int))+1) from jb_lsbm where dlbm='"+dlbm.Trim()+"' and xlbm='"+xlbm.Trim()+"'";
 5            func.data_operation dop1 = new func.data_operation();
 6            string StrId = dop1.ExeCommMax(StrSql);
 7            if(StrId==null)
 8                StrId = "1";
 9            return func.data_operation.StringFormat(StrId.Trim(),7).Trim();    
10        }

前台脚本

<script>
function WOpen(form)
{
var xlbm = func.GetMaxId.Get_lsbm(str[1],str[3]).value;
form._lsbm.value
=xlbm;

}

</script>