開発環境 VS.NET 2005 C# Oracle AjaxPro
最近忙しくて詳しく説明する時間がないので、自分の目で確認するために大まかなソースコードを載せておきます。
パフォーマンス上の理由から、州と市のレベルは JS 配列として書き込まれ、郡と地区 (町) のレベルは Oracle で書き込まれます。 C# をトリガーして JS 経由でデータベースを読み取り、データを JS に返し、表示用にバインドします。
操作 <select> は、options.add() を使用する代わりに、より一般的な createElement() を使用します。
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Area.aspx.cs" Inherits="Area" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" http://www.w3.org/1999/xhtml " >
<head runat="サーバー">
<title>地域</title>
</head>
<本文>
<form id="form1" runat="server">
<テーブル>
<tr>
<td>
<select id="SF">
<option selected="selected">—選択してください—</option>
</選択>
</td>
<td>
<select id="CS">
<option selected="selected">—選択してください—</option>
</選択>
</td>
<td>
<select id="西安">
<option selected="selected">—選択してください—</option>
</選択>
</td>
<td>
<select id="鎮">
<option selected="selected">—選択してください—</option>
</選択>
</td>
</tr>
</table>
<script type="text/javascript">
var aDQ=新しい配列();
aDQ[0]=["11","北京","0","bj"];
aDQ[1]=["12","天津","0","tj"];
aDQ[2]=["13","河北","0","hb"];
aDQ[3]=["14","山西","0","山"];
aDQ[4]=["15","内モンゴル","0","nmg"];
aDQ[5]=["21","遼寧","0","ln"];
aDQ[6]=["22","吉林","0","jl"];
aDQ[7]=["23","黒竜江省","0","hlj"];
aDQ[8]=["31","上海","0","sh"];
aDQ[9]=["32","江蘇","0","js"];
aDQ[10]=["33","浙江","0","浙江"];
aDQ[11]=["34","安徽","0","ああ"];
aDQ[12]=["35","福建省","0","fj"];
aDQ[13]=["36","江西省","0","jw"];
aDQ[14]=["37","山東","0","sd"];
aDQ[15]=["41","河南","0","彼"];
aDQ[16]=["42","湖北","0","湖"];
aDQ[17]=["43","湖南","0","hn"];
aDQ[18]=["44","広東","0","gd"];
aDQ[19]=["45","広西チワン族自治区","0","gx"];
aDQ[20]=["46","海南","0","海南"];
aDQ[21]=["50","重慶","0","cq"];
aDQ[22]=["51","四川省","0","sc"];
aDQ[23]=["52","貴州","0","貴"];
aDQ[24]=["53","雲南","0","yn"];
aDQ[25]=["54","チベット","0","トイレ"];
aDQ[26]=["61","陝西省","0","上西"];
aDQ[27]=["62","ガンス","0","gs"];
aDQ[28]=["63","青海","0","qh"];
aDQ[29]=["64","寧夏","0","nx"];
aDQ[30]=["65","新疆","0","xj"];
aDQ[31]=["71","台湾","0","tw"];
aDQ[32]=["81","香港","0","xg"];
aDQ[33]=["82","マカオ","0","午前"];
aDQ[34]=["1101","北京市","11","bjcq"];
aDQ[35]=["1102","北京県","11","bjxq"];
aDQ[36]=["1201","天津市","12","tjcq"];
aDQ[37]=["1202","天津県","12","tjxq"];
aDQ[38]=["1301","石家荘","13","sjz"];
aDQ[39]=["1302","唐山","13","hbts"];
aDQ[40]=["1303","秦皇島","13","qhd"];
aDQ[41]=["1304","邯鄲","13","hd"];
aDQ[42]=["1305","星台","13","hbxt"];
aDQ[43]=["1306","保定","13","bd"];
aDQ[44]=["1307","張家口","13","zjk"];
aDQ[45]=["1308","承徳","13","cd"];
aDQ[46]=["1309","滄州","13","hbcz"];
aDQ[47]=["1310","廊坊","13","lf"];
aDQ[48]=["1311","衡水","13","hbhs"];
aDQ[49]=["1401","太原","14","ty"];
aDQ[50]=["1402","大同","14","dt"];
aDQ[51]=["1403","陽泉","14","yq"];
aDQ[52]=["1404","長治","14","swcz"];
aDQ[53]=["1405","金城","14","swjc"];
aDQ[54]=["1406","朔州","14","swsz"];
aDQ[55]=["1501","フフホト","15","フフホト"];
aDQ[56]=["1502","包頭","15","bt"];
aDQ[57]=["1503","烏海","15","nmgwh"];
aDQ[58]=["1504","赤峰","15","cf"];
aDQ[59]=["1521","フルンボイルリーグ","15","hlbem"];
aDQ[60]=["1522","興安リーグ","15","xam"];
aDQ[61]=["1523","ゼリメン","15","zlmm"];
aDQ[62]=["1525","シリンゴルリーグ","15","wlglm"];
aDQ[63]=["1526","ウランカブリーグ","15","wlcbm"];
aDQ[64]=["1527","オルドス","15","イーズ"];
aDQ[65]=["1528","バヤンヌールリーグ","15","バイネム"];
aDQ[66]=["1529","アルクサリーグ","15","alsm"];
aDQ[67]=["2101","瀋陽","21","lnsy"];
aDQ[68]=["2102","大連","21","dl"];
aDQ[69]=["2103","鞍山","21","as"];
aDQ[70]=["2104","撫順","21","lnfs"];
aDQ[71]=["2105","ベンシー","21","bx"];
aDQ[72]=["2106","丹東","21","dd"];
aDQ[73]=["2107","錦州","21","jz"];
aDQ[74]=["2108","営口","21","yk"];
aDQ[75]=["2109","フーシン","21","fx"];
aDQ[76]=["2110","遼陽","21","1110"];
aDQ[77]=["2111","パンジン","21","pj"];
aDQ[78]=["2112","タイリング","21","lntl"];
aDQ[79]=["2113","朝陽","21","cy"];
aDQ[80]=["2114","葫蘆島","21","hld"];
aDQ[81]=["2201","長春","22","cc"];
aDQ[82]=["2202","吉林","22","jljl"];
aDQ[83]=["2203","四平","22","sp"];
aDQ[84]=["2204","遼源","22","jlly"];
aDQ[85]=["2205","通化","22","番目"];
aDQ[86]=["2206","白山","22","bs"];
aDQ[87]=["2207","松元","22","jlsy"];
aDQ[88]=["2208","白城","22","bc"];
aDQ[89]=["2224","延辺","22","jlyb"];
aDQ[90]=["2301","ハルビン","23","ヘブ"];
aDQ[91]=["2302","チチハル","23","qqhe"];
aDQ[92]=["2303","吉西","23","hljjw"];
aDQ[93]=["2304","ヘガン","23","hg"];
aDQ[94]=["2305","双崖山","23","sys"];
aDQ[95]=["2306","大慶","23","dq"];
aDQ[96]=["2307","宜春","23","hljyc"];
aDQ[97]=["2308","ジャムス","23","jms"];
aDQ[98]=["2309","キタイヘ","23","qth"];
aDQ[99]=["2310","牡丹江","23","mdj"];
aDQ[100]=["2311","ヘイヘ","23","hh"];
aDQ[101]=["3101","上海都市圏","31","shsq"];
aDQ[102]=["3102","上海県","31","shxq"];
aDQ[103]=["3201","南京","32","nj"];
aDQ[104]=["3202","無錫","32","ww"];
aDQ[105]=["3203","徐州","32","xz"];
aDQ[106]=["3204","常州","32","jscz"];
aDQ[107]=["3205","蘇州","32","蜀"];
aDQ[108]=["3206","南通","32","nt"];
aDQ[109]=["3207","連雲港","32","lyg"];
aDQ[110]=["3208","淮安","32","ハ"];
aDQ[111]=["3209","塩城","32","jsyc"];
aDQ[112]=["3210","揚州","32","yz"];
aDQ[113]=["3211","鎮江","32","jszj"];
aDQ[114]=["3212","台州","32","tz"];
aDQ[115]=["3213","宿遷","32","平方"];
aDQ[116]=["3301","杭州","33","漢"];
aDQ[117]=["3302","寧波","33","nb"];
aDQ[118]=["3303","温州","33","zjwz"];
aDQ[119]=["3304","嘉興","33","jx"];
aDQ[120]=["3305","湖州","33","zjhz"];
aDQ[121]=["3306","紹興","33","sx"];
aDQ[122]=["3307","金華","33","jh"];
aDQ[123]=["3308","衢州","33","zjqz"];
aDQ[124]=["3309","舟山","33","zjzs"];
aDQ[125]=["3310","台州","33","zjtz"];
aDQ[126]=["3311","義烏","33","yw"];
aDQ[127]=["3325","麗水","33","zjls"];
aDQ[128]=["3401","合肥","34","hf"];
aDQ[129]=["3402","蕪湖","34","wh"];
aDQ[130]=["3403","蚌埠","34","bb"];
aDQ[131]=["3404","淮南","34","hnx"];
aDQ[132]=["3405","馬鞍山","34","マス"];
aDQ[133]=["3406","淮北","34","ホイブ"];
aDQ[134]=["3407","トンリン","34","tl"];
aDQ[135]=["3408","安慶","34","aq"];
aDQ[136]=["3410","黄山","34","hs"];
aDQ[137]=["3411","チュー州","34","ahcz"];
aDQ[138]=["3412","扶陽","34","fy"];
aDQ[139]=["3413","蘇州","34","ahsz"];
aDQ[140]=["3416","豪州","34","ahhz"];
aDQ[141]=["51011117","池州","34",""];
aDQ[142]=["51011118","六安","34",""];
aDQ[143]=["51011119","宣城","34",""];
aDQ[144]=["3501","福州","35","fz"];
aDQ[145]=["3502","アモイ","35","xm"];
aDQ[146]=["3503","莆田","35","pt"];
aDQ[147]=["3504","三明","35","sm"];
aDQ[148]=["3505","泉州","35","qz"];
aDQ[149]=["3506","漳州","35","fzz"];
aDQ[150]=["3507","南平","35","np"];
aDQ[151]=["3508","ロンヤン","35","fjly"];
aDQ[152]=["3509","寧徳","35","fjnd"];
aDQ[153]=["3601","南昌","36","jwnc"];
aDQ[154]=["3602","景徳鎮","36","jdz"];
aDQ[155]=["3603","平祥","36","px"];
aDQ[156]=["3604","九江","36","jj"];
aDQ[157]=["3605","Xinyu","36","xy"];
aDQ[158]=["3606","インタン","36","jwyt"];
aDQ[159]=["3607","甘州","36","jwgz"];
aDQ[160]=["3701","済南","37","jn"];
aDQ[161]=["3702","青島","37","qd"];
aDQ[162]=["3703","Zibo","37","zb"];
aDQ[163]=["3704","棗荘","37","sdzz"];
aDQ[164]=["3705","東営","37","sddy"];
aDQ[165]=["3706","煙台","37","yt"];
aDQ[166]=["3707","濰坊","37","wf"];
aDQ[167]=["3708","済寧","37","sdjn"];
aDQ[168]=["3709","大安","37","た"];
aDQ[169]=["3710","威海","37","sdwh"];
aDQ[170]=["3711","日照","37","rz"];
aDQ[171]=["3712","莱蕪","37","lw"];
aDQ[172]=["3713","臨沂","37","ly"];
aDQ[173]=["3714","テキサス","37","sddz"];
aDQ[174]=["3715","聊城","37","lc"];
aDQ[175]=["4101","鄭州","41","鄭"];
aDQ[176]=["4102","開封","41","kf"];
aDQ[177]=["4103","洛陽","41","hnly"];
aDQ[178]=["4104","平頂山","41","pds"];
aDQ[179]=["4105","安養","41","ay"];
aDQ[180]=["4106","ヘビ","41","ヘビ"];
aDQ[181]=["4107","新郷","41","xx"];
aDQ[182]=["4108","焦作","41","hnjz"];
aDQ[183]=["4109","濮陽","41","zy"];
aDQ[184]=["4110","許昌","41","xc"];
aDQ[185]=["4111","漯河","41","浙江"];
aDQ[186]=["4112","三門峡","41","smx"];
aDQ[187]=["4113","南陽","41","ニューヨーク"];
aDQ[188]=["4114","商丘","41","hnsq"];
aDQ[189]=["4115","信陽","41","hnxy"];
aDQ[190]=["4201","武漢","42","hbwh"];
aDQ[191]=["4202","イエローストーン","42","hhs"];
aDQ[192]=["4203","シヤン","42","sy"];
aDQ[193]=["4205","宜昌","42","hbyc"];
aDQ[194]=["4206","シャンファン","42","xf"];
aDQ[195]=["4207","鄂州","42","ez"];
aDQ[196]=["4208","ジンメン","42","hbjm"];
aDQ[197]=["4209","シャオガン","42","hbxg"];
aDQ[198]=["4210","荊州","42","hbjz"];
aDQ[199]=["4211","黄崗","42","hbhg"];
aDQ[200]=["4212","咸寧","42","xn"];
aDQ[201]=["4228","エンシ","42","es"];
aDQ[202]=["4301","長沙","43","cs"];
aDQ[203]=["4302","株州","43","hnzz"];
aDQ[204]=["4303","シャンタン","43","xt"];
aDQ[205]=["4304","衡陽","43","hnhy"];
aDQ[206]=["4305","シャオヤン","43","シャオ"];
aDQ[207]=["4306","岳陽","43","yy"];
aDQ[208]=["4307","常徳","43","hncd"];
aDQ[209]=["4308","張家界","43","zjj"];
aDQ[210]=["4309","イーヤン","43","フニー"];
aDQ[211]=["4310","郴州","43","hncz"];
aDQ[212]=["4311","永州","43","hnyz"];
aDQ[213]=["4312","懐華","43","hnhh"];
aDQ[214]=["4331","翔西","43","xw"];
aDQ[215]=["4401","広州","44","gz"];
aDQ[216]=["4402","韶関","44","sg"];
aDQ[217]=["4403","深セン","44","sz"];
aDQ[218]=["4404","珠海","44","zh"];
aDQ[219]=["4405","汕頭","44","st"];
aDQ[220]=["4406","佛山","44","fs"];
aDQ[221]=["4407","江門","44","jm"];
aDQ[222]=["4408","湛江","44","zj"];
aDQ[223]=["4409","茂名","44","mm"];
aDQ[224]=["4412","肇慶","44","zq"];
aDQ[225]=["4413","恵州","44","hz"];
aDQ[226]=["4414","梅州","44","mz"];
aDQ[227]=["4415","汕頭","44","汕頭"];
aDQ[228]=["4416","河源","44","hy"];
aDQ[229]=["4417","陽江","44","yj"];
aDQ[230]=["4418","清源","44","qy"];
aDQ[231]=["4419","東莞","44","dz"];
aDQ[232]=["4420","中山","44","zs"];
aDQ[233]=["4451","潮州","44","cz"];
aDQ[234]=["4452","掲陽","44","jy"];
aDQ[235]=["4453","ユンフ","44","yf"];
aDQ[236]=["4501","南寧","45","nn"];
aDQ[237]=["4502","柳州","45","lz"];
aDQ[238]=["4503","桂林","45","gwgl"];
aDQ[239]=["4504","梧州","45","gwwz"];
aDQ[240]=["4505","北海","45","bh"];
aDQ[241]=["4506","方城港","45","fcg"];
aDQ[242]=["4507","欽州","45","gqz"];
aDQ[243]=["4508","貴港","45","gg"];
aDQ[244]=["4509","ユリン","45","イル"];
aDQ[245]=["4601","海口","46","香港"];
aDQ[246]=["4602","三亜","46","hnsy"];
aDQ[247]=["5002","重慶県","50","zqxq"];
aDQ[248]=["5003","重慶市","50","zqcq"];
aDQ[249]=["5101","成都","51","sccd"];
aDQ[250]=["5103","自貢","51","zg"];
aDQ[251]=["5104","攀枝花","51","pzh"];
aDQ[252]=["5105","蘆州","51","sczz"];
aDQ[253]=["5106","デヤン","51","ディ"];
aDQ[254]=["5107","綿陽","51","私の"];
aDQ[255]=["5108","広元","51","gy"];
aDQ[256]=["5109","水寧","51","sn"];
aDQ[257]=["5110","内江","51","scnj"];
aDQ[258]=["5111","楽山","51","ls"];
aDQ[259]=["5113","南充","51","nc"];
aDQ[260]=["5115","イービン","51","yb"];
aDQ[261]=["5116","広安","51","が"];
aDQ[262]=["5130","達州","51","scdz"];
aDQ[263]=["5132","アババ","51","ab"];
aDQ[264]=["5133","ガンジ","51","scgz"];
aDQ[265]=["5134","梁山","51","scls"];
aDQ[266]=["5201","貴陽","52","gzgy"];
aDQ[267]=["5202","六盤水","52","lps"];
aDQ[268]=["5203","遵義","52","gzzy"];
aDQ[269]=["5223","貴州南西部","52","qwn"];
aDQ[270]=["5226","黔東南","52","qdn"];
aDQ[271]=["5227","黔南","52","qn"];
aDQ[272]=["5301","昆明","53","km"];
aDQ[273]=["5303","曲経","53","qj"];
aDQ[274]=["5304","ユクシ","53","yx"];
aDQ[275]=["5323","楚雄","53","cx"];
aDQ[276]=["5325","红河","53","ynhh"];
aDQ[277]=["5326","文山","53","ws"];
aDQ[278]=["5328","西双版納","53","wsbn"];
aDQ[279]=["5329","ダリ","53","yndl"];
aDQ[280]=["5331","デホン","53","dh"];
aDQ[281]=["5333","怒江","53","nuj"];
aDQ[282]=["5334","迪慶","53","yndq"];
aDQ[283]=["51010963","麗江市","53","ljs"];
aDQ[284]=["51012663","宝山","53",""];
aDQ[285]=["5401","ラサ","54","wcls"];
aDQ[286]=["6101","西安","61","和"];
aDQ[287]=["6102","東川","61","tc"];
aDQ[288]=["6103","宝鶏","61","swbj"];
aDQ[289]=["6104","咸陽","61","swxy"];
aDQ[290]=["6105","渭南","61","swwn"];
aDQ[291]=["6106","延安","61","や"];
aDQ[292]=["6107","漢中","61","swhz"];
aDQ[293]=["6201","蘭州","62","gslz"];
aDQ[294]=["6202","嘉峪関","62","jyg"];
aDQ[295]=["6203","金昌","62","jc"];
aDQ[296]=["6204","シルバー","62","by"];
aDQ[297]=["6205","天水","62","ts"];
aDQ[298]=["6229","リンシア","62","1x"];
aDQ[299]=["6230","ガンナン","62","GN"];
aDQ[300]=["6301","西寧","63","wn"];
aDQ[301]=["6322","海北","63","海"];
aDQ[302]=["6323","黄南","63","黄"];
aDQ[303]=["6325","海南","63","qhhn"];
aDQ[304]=["6326","Guoluo","63","gl"];
aDQ[305]=["6327","ユシュ","63","イース"];
aDQ[306]=["6328","海西","63","hw"];
aDQ[307]=["6401","銀川","64","yc"];
aDQ[308]=["6402","紫瑞山","64","szs"];
aDQ[309]=["6403","呉中","64","wz"];
aDQ[310]=["6405","中卫","64","zw"];
aDQ[311]=["6501","ウルムチ","65","wlmq"];
aDQ[312]=["6502","Klmy","65","Klmy"];
aDQ[313]=["6523","チャンジ","65","cj"];
aDQ[314]=["6527","ボルタラ","65","ベットル"];
aDQ[315]=["6528","バインゴレン","65","bygl"];
aDQ[316]=["6530","キジルス・キルギス","65","kzlskekz"];
aDQ[317]=["6540","Ili","65","xjyl"];
aDQ[318]=["7101","台北","71",""];
aDQ[319]=["7102","宜蘭","71",""];
aDQ[320]=["7103","桃園","71",""];
aDQ[321]=["7104","新竹","71",""];
aDQ[322]=["7105","苗栗","71",""];
aDQ[323]=["7106","台中","71",""];
aDQ[324]=["7107","彰化","71",""];
aDQ[325]=["7108","南投","71",""];
aDQ[326]=["7109","雲林","71",""];
aDQ[327]=["7110","嘉義","71",""];
aDQ[328]=["7111","台南","71",""];
aDQ[329]=["7112","高雄","71",""];
aDQ[330]=["7113","屏東","71",""];
aDQ[331]=["7114","台東","71",""];
aDQ[332]=["7115","花蓮","71",""];
aDQ[333]=["7116","澎湖","71",""];
aDQ[334]=["7117","基隆","71",""];
aDQ[335]=["7118","金門","71",""];
aDQ[336]=["7119","媽祖","71",""];
aDQ[337]=["8101","新領域","81",""];
aDQ[338]=["8102","香港島","81",""];
aDQ[339]=["8103","ランタオ島","81",""];
aDQ[340]=["8104","九龍","81",""];
aDQ[341]=["8201","マカオ島","82",""];
aDQ[342]=["8202","タイパ","82",""];
aDQ[343]=["8203","Coloane","82",""];
//DOM を通じてドロップダウン ボックスを作成しますhttp://www.downcodes.com/qq.asp
//obj: ドロップダウン ボックスのオプション データ セット
//id: ドロップダウン ボックスの ID
関数 CreateDropDownList(obj,id)
...{
var sel=document.getElementById(id);
sel.options.length=1; //保存 "—選択してください—"
//配列ストレージは州や市によく使用され、郡や町のデータベースからの読み取りには C# が使用されます。
if(obj==null)return;
if(配列のオブジェクトインスタンス)
...{
for(var i=0;i<obj.length;i++)
...{
var op=document.createElement("オプション");
op.setAttribute("値",obj[i][0]);
var txt=document.createTextNode(obj[i][1]);
op.appendChild(txt);
sel.appendChild(op);
}
}
それ以外
...{
for(var i=0;i<obj.Rows.length;i++) //これは数ではなく長さであることに注意してください
...{
var op=document.createElement("オプション");
op.setAttribute("value",obj.Rows[i].ID); //大文字と小文字が区別されることに注意してください。
var txt=document.createTextNode(obj.Rows[i].NAME); //ルート DataTable の列名は一貫している必要があります。
op.appendChild(txt);
sel.appendChild(op);
}
}
//次のドロップダウン ボックスをバインドします
スイッチ(ID)
...{
case "SF":sel.onchange=function()....{ClearXianZhen();CreateDropDownList(GetArray(this.value),"CS");};break;
case "CS":sel.onchange=function()....{ClearZhen();CreateDropDownList(Area.GetDataTable(this.value,AreaEnum.Xian).value,"Xian");};break; /JS はパラメーターを C# に渡し、C# の戻り値を取得します
case "Xian":sel.onchange=function()...{CreateDropDownList(Area.GetDataTable(this.value,AreaEnum.Zhen).value,"Zhen");};break; //値を返します。
デフォルト:sel.onchange=function()....{alert(this.value);};break;
}
}
//実行エントリ
var arr=GetArray("0");
CreateDropDownList(arr,"SF");
//必要な配列を取得します。
//tar=所属する県ID
関数 GetArray(val)
...{
var temp=新しい配列();
var j=0;
for(var i=0;i<aDQ.length;i++)
...{
if(aDQ[i][2].toString()==val)
...{
temp[j]=aDQ[i];
//temp[j].push(aDQ[i]);
j++;
}
}
戻り温度;
}
//「町」ドロップダウンボックスをクリアします
関数 ClearZhen()
...{
CreateDropDownList(null,"Zhen");
}
//「郡」と「町」のドロップダウン ボックスをクリアします
関数 ClearXianZhen()
...{
CreateDropDownList(null,"西安");
CreateDropDownList(null,"Zhen");
</script>
</form>
</body>
</html>
システムを使用する;
System.Data を使用します。
System.Data.OracleClient を使用する
パブリック部分クラス領域: System.Web.UI.Page
...{
protected void Page_Load(オブジェクト送信者, EventArgs e)
...{
//C#のクラスと列挙型をそれぞれJSに登録
AjaxPro.Utility.RegisterTypeForAjax(typeof(Area));
AjaxPro.Utility.RegisterEnumForAjax(typeof(AreaEnum));
}
/**//// <概要>
/// ドロップダウン ボックスに必要なデータを取得します
/// </概要>
/// <param name="UpID">上位レベル ID</param>
/// <param name="ae">郡/町</param>
/// <Returns> return datatable </returns>
[AjaxPro.AjaxMethod]
public DataTable GetDataTable(string UpID, AreaEnum ae)
...{
if (String.IsNullOrEmpty(UpID))
null を返す;
文字列リンク = "サーバー=XXX;ユーザー=XXX;pwd=XXX;";
OracleConnection conn = new OracleConnection(link);
//Oracle によって返される DataTable の列名はすべて大文字です。ページ上の値をフェッチするときは、必ず大文字を使用してください。
文字列SQL;
if (Enum.Equals(ae, AreaEnum.Xian))
sql = "都市 WHERE THREEID=0 AND TWOID=" + UpID から ID、名前を選択します。
それ以外
sql = "SELECT id,name FROM City WHERE THREEID=" +
OracleDataAdapter アダプタ = new OracleDataAdapter(sql, conn);
DataTable テーブル = 新しい DataTable();
アダプタ.Fill(テーブル);
テーブルを返します。
}
}
/**//// <概要>
///リージョンの列挙
/// </概要>
パブリックエインムエリアネム
...{
/**//// <概要>
///郡
/// </概要>
西安
/**//// <概要>
/// 町
/// </概要>
ジェン
この
時点では、基本的な機能が実装されており、いくつかの機能もあります (ドメイン名IP を通じて地域を決定し、直接バインドする、選択した地域を保存する、コントロールを作成するために便利な都市情報を読み取り/保存するなど)。時間ができたら終わらせます。
Web.config の <system.web> に
<httpHandlers>
を忘れずに追加してください。
<addverb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
</httpハンドラー>