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

推荐订阅源

AWS News Blog
AWS News Blog
T
Tenable Blog
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 热门话题
T
Threat Research - Cisco Blogs
T
Threatpost
Security Latest
Security Latest
C
Cisco Blogs
L
Lohrmann on Cybersecurity
S
Security @ Cisco Blogs
Google Online Security Blog
Google Online Security Blog
NISL@THU
NISL@THU
AI
AI
V
Vulnerabilities – Threatpost
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Last Watchdog
The Last Watchdog
G
GRAHAM CLULEY
Cloudbric
Cloudbric
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Hacker News: Front Page
U
Unit 42
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MyScale Blog
MyScale Blog
O
OpenAI News
Scott Helme
Scott Helme
V2EX - 技术
V2EX - 技术
P
Proofpoint News Feed
博客园 - 叶小钗
Hugging Face - Blog
Hugging Face - Blog
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cyberwarzone
Cyberwarzone
博客园 - 【当耐特】
H
Heimdal Security Blog
S
Schneier on Security
阮一峰的网络日志
阮一峰的网络日志
Help Net Security
Help Net Security
D
DataBreaches.Net
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
TaoSecurity Blog
TaoSecurity Blog
K
Kaspersky official blog
N
News and Events Feed by Topic
WordPress大学
WordPress大学
P
Palo Alto Networks Blog

博客园 - CooS

PowerDesigner使用心得 有意思的图片 到底是顺时针还是逆时针旋转呢? - CooS - 博客园 又是两个小错误 Windows服务 System.StackOverflowException 小错误 大杂烩-今天遇到的问题的总结 .NET相关资源 杀毒 请问:javascript 如何新建一个类的对象 如:work w = new work() File.Delete不能删除文件的问题 笑话 用google搜索时它会告诉你找到多少页面。这里规定找到页面多的一方胜(zz) 人生的状态是由自己心灵的温度决定的 Oracle函数列表速查(zz) 在oracle9i中创建自增序列-触发器(zz) 背上的爱(zz) 程序人生 - 我已经努力了七年(zz) 美女当道,丑女孩会有爱情吗?(zz)
小试Ajax-下拉框联动
CooS · 2006-03-30 · via 博客园 - CooS


 本文参考http://singlepine.cnblogs.com/articles/257954.html,学习一把Ajax

表示感谢

1.Html

<HTML>
    
<HEAD>
        
<meta name="vs_snapToGrid" content="False">
        
<title>Test</title>
        
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        
<meta name="CODE_LANGUAGE" Content="C#">
        
<meta name="vs_defaultClientScript" content="JavaScript">
        
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
        
<script language="javascript">
        
function TBRResult()
        
{
            
var TBR = document.getElementById("TBDW");
            AjaxClass.GetTBRData(TBR.value,get_TBR_Result_CallBack);
        }

        
        
function get_TBR_Result_CallBack(response)
        
{
            
if(response != null)
            
{
                document.all(
"TBR").length=0;
                
var ds = response.value;
                
if((ds != null)&&typeof(ds)=="object"&&ds.Tables!=null)
                
{
                    
for (var i = 0;i < ds.Tables[0].Rows.length; i++)
                    
{
                        
var ID = ds.Tables[0].Rows[i].USER_ID;
                      
var NAME = ds.Tables[0].Rows[i].USER_NAME;
                      document.all(
"TBR").options.add(new Option(NAME,ID));
                    }

                }

            }

            
return
        }

        
</script>
    
</HEAD>
    
<body MS_POSITIONING="GridLayout">
        
<form id="Form1" method="post" runat="server">
            
<FONT face="宋体">
                
<asp:dropdownlist id="TBDW" style="Z-INDEX: 101; LEFT: 200px; POSITION: absolute; TOP: 120px" runat="server"
                    Width
="120px"></asp:dropdownlist>
                
<asp:dropdownlist id="TBR" style="Z-INDEX: 102; LEFT: 352px; POSITION: absolute; TOP: 120px" runat="server"
                    Width
="120px"></asp:dropdownlist></FONT>
        
</form>
    
</body>
</HTML>

2.后台cs

Ajax.Utility.RegisterTypeForAjax(typeof(AjaxClass));
            
if(!this.IsPostBack)
            
{
                
//绑定填报单位下拉列表框
                DataSet ds = new AjaxClass().GetTBDWData();
                shareFunction.BindDropDownList(
"","ORG_NAME","ORG_ID",TBDW,ds);
                TBDW.Attributes.Add(
"onclick","TBRResult();");
            }

3.AjaxClass

        public AjaxClass()
        
{
            
//
            
// TODO: 在此处添加构造函数逻辑
            
//
        }


        
获取填报单位数据

        
获取填报人数据

4.GetData取数据

        public GetData()
        
{
            
//
            
// TODO: 在此处添加构造函数逻辑
            
//
        }

        

        
public DataSet GetTBDWData()
        
{
            
//绑定填报单位下拉列表框
            string SQL = "select * from ORGANIZATION order by ORG_ID";
            DataSet ds 
= shareDataOperation.ExecuteSelectSql(SQL,"ORGANIZATION");
            
return ds;
        }


        
public DataSet GetTBRData(string DWID)
        
{
            
//绑定填报人下拉列表框
            string SQL = "select * from USERS where ORG_ID="+ DWID;
            DataSet ds 
= shareDataOperation.ExecuteSelectSql(SQL,"USERS");
            
return ds;
        }

5.web.config

<httpHandlers>
        
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" />
   
</httpHandlers>