- 浏览: 19510 次
- 性别:
- 来自: 苏州
最新评论
$(document).ready(
function() {
var continentid = document.getElementById("").value;
var countryid = document.getElementById("").value;
var cityid = document.getElementById("").value;
$.ajax({ type: "POST",
contentType: "application/json;charset=utf-8",
url: "/Services/CountryService.asmx/GetContinentList",
data: "{}",
dataType: "json",
success: function(result) {
ClearContinent();
ClearCountry();
ClearCity();
$("").appendTo("#Continent");
var getContinentID = document.getElementById("").value;
if (getContinentID > 0) {
document.getElementById("").value = getContinentID;
}
$.each(result.d, function() {
if (this.Id == getContinentID) {
$("" + this.Name + "").appendTo("#Continent");
} else {
$("" + this.Name + "").appendTo("#Continent");
}
});
InitSelectContinent(getContinentID);
}
});
}
); function InitSelectContinent(obj) {
if (obj > 0) {
CountryAjax(obj);
}
} function ContinentOnchange() {
ClearHiddenValue();
var selectContinentId = $("#Continent").val();
document.getElementById("").value = selectContinentId;
CountryAjax(selectContinentId);
} function CountryAjax(obj) {
ClearCountry();
ClearCity();
$.ajax({ type: "POST",
contentType: "application/json;charset=utf-8",
url: "/Services/CountryService.asmx/GetCountryListById" ,
data: "{'continentId':" + obj + "}",
dataType: "json",
success: function(result) {
$("").appendTo("#Country");
var getCountryID = document.getElementById("").value;
if (getCountryID > 0) {
document.getElementById("").value = getCountryID;
}
$.each(result.d, function() {
if (this.Id == getCountryID) {
$("" + this.Name + "").appendTo("#Country");
}
else {
$("" + this.Name + "").appendTo("#Country");
}
});
if (getCountryID > 0) {
CityAjax(getCountryID);
}
}
});
} function CountryOnchange() {
var selectcountryId = $("#Country").val();
document.getElementById("").value = selectcountryId;
CityAjax(selectcountryId);
} function CityAjax(obj) {
ClearCity();
$.ajax({ type: "POST",
contentType: "application/json;charset=utf-8",
url: "/Services/CountryService.asmx/GetCityListById",
data: "{'countryId':" + obj + "}",
dataType: "json",
success: function(result) {
$("").appendTo("#City");
var getCityID = document.getElementById("").value;
if (getCityID > 0) {
document.getElementById("").value = getCityID;
}
$.each(result.d, function() {
if (this.Id == getCityID) {
$("" + this.Name + "").appendTo("#City");
} else {
$("" + this.Name + "").appendTo("#City");
}
});
}
});
}
function CityOnchange() {
document.getElementById("").value = $("#City").val();
} function ClearContinent() {
$("#Continent").empty();
document.getElementById("").value = 0;
} function ClearCountry() {
$("#Country").empty();
document.getElementById("").value = 0;
} function ClearCity() {
$("#City").empty();
document.getElementById("").value = 0;
} function ClearHiddenValue() {
document.getElementById("").value = 0;
document.getElementById("").value = 0;
document.getElementById("").value = 0;
}
using System;
using Daps.Common.Utilities;
namespace Daps.En.WebSite.Controls
{
public partial class CountryCtrl : System.Web.UI.UserControl
{
public int ContinentID
{
get
{
return Convert.ToInt32(this.Hidden_ContinentId.Value);
}
} public int CountryID
{
get
{
return Convert.ToInt32(this.Hidden_CountryId.Value);
}
} public int CityID
{
get
{
return Convert.ToInt32(this.Hidden_CityId.Value);
}
} protected override void OnLoad(EventArgs e)
{
this.Hidden_GetContinentId.Value = SecurityHelper.RequestQueryNum("ContinentID").ToSt ring();
this.Hidden_GetCountryId.Value = SecurityHelper.RequestQueryNum("CountryID").ToStri ng();
this.Hidden_GetCityId.Value = SecurityHelper.RequestQueryNum("CityID").ToString( );
}
}
}
发表评论
-
java截取字符串
2012-07-06 09:51 685★☆★☆★☆★☆★☆★☆ 夫子是神圣的而我是荒诞的 ... -
正则表达式 - 自动生成器
2012-07-06 09:45 1033正则表达式的强大众所周知,它令程序员的头痛程度也数一数二的 ... -
常用的正则表达式
2012-07-06 09:37 623常用表达式: "^\d+$" // ... -
用VC把 图片做成独立的 DLL的两种方法
2012-07-06 09:30 817用VC把 图片做成独 ... -
组件、控件和插件的区别
2012-07-03 13:42 610组件、控件和插件 ... -
组件、控件和插件的区别
2012-07-03 12:19 940组件、控件和插件 ... -
flex datagird渲染图片和按钮
2012-07-02 10:15 587用户操作 [留言] [发消息] [加为好友] ... -
Flex property style
2012-07-02 10:15 595用户操作 [留言] [发消息] [加为好友] ... -
FLEX文件下载
2012-07-02 10:15 560文件下载没有文件上传那么麻烦,只需从服务器指定的目录获取即 ... -
FLEX 条形图(柱状图)设置刻度为百分比
2012-07-02 10:15 643作者原创,如需转载请注明出处:www.krzone.org ... -
Flex和Spring的整合
2012-07-01 09:37 454关于Flex Adobe Flex是一套创建富客户端应用( ... -
实现FLEX 通过AMF跟PHP通信
2012-07-01 09:37 819AMF flex一种远调用 ... -
Java Server Push To Flex (ServerPush)
2012-07-01 09:37 516在网上找了许多的Flex与java 通信做ServerPu ... -
Flex编程学习基础
2012-07-01 09:37 672Flex是Adobe公司推出 ... -
Flex + LCDS + Java 入门教程
2012-07-01 09:37 468一.引 很多 ... -
关于vs2005的“应用程序配置不正确,无法运行”问题的解决方法
2012-06-30 17:53 622关于vs2005的"应 ... -
无输入法的解决方法
2012-06-30 17:53 5411、一般来说,我们 ... -
WordPress初级教程-20: 忘记Wordpress密码的5种解决方法
2012-06-30 17:53 804来源于 WordPress初级教程-20: 忘记Wordp ... -
TC2.0 在winxp下initgraph崩溃原因以及解决方法
2012-06-30 17:53 822用rectangle()函数。 你得 ...
相关推荐
ajax+asp.net2.0
Ajax下拉框Ajax联动下拉框实现的例子
Ajax 联动菜单 Ajax 联动菜单Ajax 联动菜单
asp.net中dropdownlist使用AJAX联动
Asp Ajax 联动菜单 很好很实用. 测试没问题.
多次解决多级联动菜单不成 无法将数据库的内容与界面联系起来
多功能JS下拉框组件,含Ajax联动,适时编辑值
java+Ajax 连接数据库 联动效果
Asp+Ajax无限级联动下拉框菜单Access版
JSP+Ajax二级联动实例,JSP+Ajax二级联动实例。
ajax 省级 市级 联动效果 Java java web ajax 实现的省级联动效果。 demo
经常有很多朋友遇到浏览器不兼容的烦恼,在此将自己的心得分享给大家。
ajax 异步请求数据后返回绑定控件 //处理DOM对象 function dealXml() { var xmlDoc = xmlHttp.responseXML; var objSel_goodsDesc = document.getElementById("sel_goodsDesc"); var items= xmlDoc....
AJAX省市联动 jsp 不是自己写的,和大家分享一下
用Ajax实现的无刷新省市区三级联动和分页
最近收集了很多联动菜单. 下拉联动菜单,有涉及到数据库的,有ajax的,有无限级ajax联动菜单. ....
ajax实例 ajax联动 用Java语言写的ajax实例,很典型
ajax 联动菜单,操作的是数据库,是一个非常值得学习的实例。此外还用到了dwr,将js和java文件联系起来,操作起来非常方便。
参考了很多例子,最终还是自己摸索着ajax了一把..- -b,希望对正在找这方面例子的朋友有用,此压缩包包含2个文件DynamicDrop.aspx[XMLHTTPRequest请求页],DynamicDrop.ashx.cs[服务器端处理页]