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

推荐订阅源

N
Netflix TechBlog - Medium
I
Intezer
人人都是产品经理
人人都是产品经理
F
Full Disclosure
A
About on SuperTechFans
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Blog — PlanetScale
Blog — PlanetScale
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
博客园 - 司徒正美
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
L
LangChain Blog
Last Week in AI
Last Week in AI
B
Blog
Project Zero
Project Zero
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
U
Unit 42
B
Blog RSS Feed
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Privacy International News Feed
N
News and Events Feed by Topic
W
WeLiveSecurity
Cloudbric
Cloudbric
G
GRAHAM CLULEY
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Check Point Blog
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Latest news
Latest news
S
Secure Thoughts
Simon Willison's Weblog
Simon Willison's Weblog
Scott Helme
Scott Helme
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity 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>