AJAX实现无刷新三联动下拉框
2006-08-14 16:09
447 查看
1、webconfig设置
(1)在system.web区添加:
<httpHandlers>
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro" />
</httpHandlers>
(2)在configuration区添加数据库连接字符串:
<add key="ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Test\AjaxTest\DB\db.mdb;User ID='admin';" />
2、html代码:
<%@ Page language="c#" Codebehind="DropDownList.aspx.cs" AutoEventWireup="false" Inherits="AjaxTest.DropDownList" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>DropDownList</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script language="javascript" type="text/javascript">
function cityResult()//城市
function callback_GetCityList( response )//回调
function areaResult()//县,区
function callback_GetAreaList( response )
function GetData()
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P><asp:dropdownlist id="DropDownList1" runat="server" Width="150px"></asp:dropdownlist><br>
<asp:dropdownlist id="DropDownList2" runat="server" Width="150px"></asp:dropdownlist><br>
<asp:dropdownlist id="DropDownList3" runat="server" Width="150px"></asp:dropdownlist><br>
<br>
<INPUT type="button" value="显示所选数据" onclick="GetData();">
<asp:TextBox id="TextBox1" runat="server" Width="688px"></asp:TextBox></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
</form>
</body>
</HTML>
3、cs代码:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace AjaxTest
4、AjaxMethod方法类库:
using System;
using System.Data;
using System.Data.OleDb;
namespace AjaxTest
5、数据库文件:
/Files/wander/db.rar
(1)在system.web区添加:
<httpHandlers>
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro" />
</httpHandlers>
(2)在configuration区添加数据库连接字符串:
<add key="ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Test\AjaxTest\DB\db.mdb;User ID='admin';" />
2、html代码:
<%@ Page language="c#" Codebehind="DropDownList.aspx.cs" AutoEventWireup="false" Inherits="AjaxTest.DropDownList" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>DropDownList</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script language="javascript" type="text/javascript">
function cityResult()//城市
function callback_GetCityList( response )//回调
function areaResult()//县,区
function callback_GetAreaList( response )
function GetData()
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P><asp:dropdownlist id="DropDownList1" runat="server" Width="150px"></asp:dropdownlist><br>
<asp:dropdownlist id="DropDownList2" runat="server" Width="150px"></asp:dropdownlist><br>
<asp:dropdownlist id="DropDownList3" runat="server" Width="150px"></asp:dropdownlist><br>
<br>
<INPUT type="button" value="显示所选数据" onclick="GetData();">
<asp:TextBox id="TextBox1" runat="server" Width="688px"></asp:TextBox></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
</form>
</body>
</HTML>
3、cs代码:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace AjaxTest
4、AjaxMethod方法类库:
using System;
using System.Data;
using System.Data.OleDb;
namespace AjaxTest
5、数据库文件:
/Files/wander/db.rar
相关文章推荐
- Ajax实现无刷新的三联动下拉框
- Ajax实现无刷新三联动下拉框
- 用Ajax.net实现的一个无刷新的多级联动下拉列表框
- Ajax实现无刷新三联动下拉框
- Ajax实现无刷新三联动下拉框
- Ajax实现无刷新三联动下拉框
- Ajax实现无刷新三联动下拉框
- Ajax实现无刷新三联动下拉框
- Ajax+Servlet实现无刷新下拉联动
- Ajax实现无刷新三联动下拉框
- Ajax实现无刷新三联动下拉框
- Ajax实现无刷新三联动下拉框 VS2005 ASP.NET DropDownList
- 【Ajax实现无刷新三联动下拉框】
- Ajax实现无刷新三联动下拉框
- 用Ajax.net实现的一个无刷新的多级联动下拉列表框
- Ajax实现无刷新三联动下拉框
- Ajax实现无刷新三联动下拉框
- AJAX实现无刷新三联动下拉框
- Ajax实现无刷新三联动下拉框
- Ajax+Servlet实现无刷新下拉联动效果