首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

哪位兄弟给小弟一个DropDownList的二级联动的例子?解决思路

2012-01-02 
哪位兄弟给小弟一个DropDownList的二级联动的例子?一、现在做的项目里面要有两个DropDownList二级联动,比如

哪位兄弟给小弟一个DropDownList的二级联动的例子?
一、现在做的项目里面要有两个DropDownList二级联动,比如说,我选择辽宁省,在第  二个DropDownList里例出辽宁省所有的市.
二、编辑用户的资料的时候,如果客户资料里的地址是辽宁省沈阳市,那么在第一  个DropDownList里辽宁省是被选择状态,地二个DropDownList沈阳市是被选择。

我鼓捣半天了,Ajax实在是不熟练,求各位指点迷津啊!

[解决办法]
http://www.cnblogs.com/thcjp/archive/2006/08/29/489491.html
你到博客园那里去看看,里面有个,不知道是不是你说的.
[解决办法]
http://www.webjx.com/htmldata/2005-10-15/1129345932.html
http://www.wujianrong.com/archives/2006/07/ajaxr.html
你看这两个都是不刷新的
[解决办法]
或者直接
http://www.google.cn/search?complete=1&hl=zh-CN&q=%E6%97%A0%E5%88%B7%E6%96%B02%E7%BA%A7%E8%81%94%E5%8A%A8&meta=
[解决办法]
http://www.a0923.com/CascadingDropDown/CascadingDropDown.aspx

整个开源的框架。

呵呵
[解决办法]
呵呵,那个我就看懂了.我是新手.......
[解决办法]
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "TicketIncomeAdd.aspx.cs " Inherits= "Dep2Sheet_TicketIncomeAdd " %>

<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 散票收入添加 </title>
<link href= "../App_Themes/blue/style.css " rel= "stylesheet " type= "text/css " />
</head>
<body>
<!--#include file= "../inc/ActiveCalendar.js "-->
<form id= "form1 " runat= "server ">
<div>
<asp:Label ID= "Label1 " runat= "server " CssClass= "officedoc " Font-Bold= "True " Text= "散票收入添加 "> </asp:Label>
<asp:ScriptManager ID= "ScriptManager1 " runat= "server ">
</asp:ScriptManager>
<br />
<asp:ValidationSummary ID= "ValidationSummary1 " runat= "server " CssClass= "officedoc "
ShowMessageBox= "True " ShowSummary= "False " />
<br />
<asp:RequiredFieldValidator ID= "RequiredFieldValidator1 " runat= "server " ControlToValidate= "tbDate "
CssClass= "officedoc " Display= "None " ErrorMessage= "请输入日期 "> </asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID= "RequiredFieldValidator2 " runat= "server " ControlToValidate= "tbIncome "
CssClass= "officedoc " Display= "None " ErrorMessage= "请输入收入金额 "> </asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID= "RequiredFieldValidator3 " runat= "server " ControlToValidate= "tbRate "
CssClass= "officedoc " Display= "None " ErrorMessage= "请输入提成系数 "> </asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID= "RegularExpressionValidator1 " runat= "server " ControlToValidate= "tbIncome "
CssClass= "officedoc " Display= "None " ErrorMessage= "您输入的收入金额格式有误,请重新输入 " ValidationExpression= "\d+(\.\d\d)? "> </asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ID= "RegularExpressionValidator2 " runat= "server " ControlToValidate= "tbRate "


CssClass= "officedoc " Display= "None " ErrorMessage= "您输入的提成系数格式有误,请重新输入 " ValidationExpression= "\d+(\.\d(\d)?)? "> </asp:RegularExpressionValidator> <br />
<table border= "0 " class= "ReformList officedoc ">
<tr>
<td align= "right " style= "width: 75px ">
日期: </td>
<td style= "width: 100px ">
<asp:TextBox ID= "tbDate " runat= "server " onclick= "setday(this) " onmouseover= "this.style.cursor= 'hand '; " Width= "100px "> </asp:TextBox> </td>
<td align= "right " style= "width: 74px ">
</td>
<td style= "width: 100px ">
</td>
</tr>
<tr>
<td align= "right " style= "width: 75px; height: 16px ">
驾驶员: </td>
<td colspan= "3 " style= "height: 16px ">
<asp:UpdatePanel runat= "server " ID= "upDriver ">
<ContentTemplate>
<asp:DropDownList ID= "ddlDept " runat= "server " AutoPostBack= "True " OnSelectedIndexChanged= "ddlDept_SelectedIndexChanged ">
</asp:DropDownList>
<asp:DropDownList ID= "ddlTeam " runat= "server " AutoPostBack= "True " OnSelectedIndexChanged= "ddlTeam_SelectedIndexChanged ">
</asp:DropDownList>
<asp:DropDownList ID= "ddlDriver " runat= "server ">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align= "right " style= "width: 75px ">
收入金额: </td>
<td style= "width: 100px ">
<asp:TextBox ID= "tbIncome " runat= "server " Width= "100px " AutoPostBack= "True " OnTextChanged= "tbRate_TextChanged "> </asp:TextBox> </td>
<td align= "right " style= "width: 74px ">
提成系数: </td>
<td style= "width: 100px ">
<asp:TextBox ID= "tbRate " runat= "server " Width= "50px " AutoPostBack= "True " OnTextChanged= "tbRate_TextChanged "> </asp:TextBox> % </td>
</tr>
<tr>
<td align= "right " style= "width: 75px ">
提成金额: </td>
<td style= "width: 100px ">
<asp:UpdatePanel runat= "server " ID= "upBonus " ChildrenAsTriggers= "False " UpdateMode= "Conditional ">
<ContentTemplate>
<asp:TextBox ID= "tbBonus " runat= "server " Width= "100px "> </asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID= "tbIncome " EventName= "TextChanged " />


<asp:AsyncPostBackTrigger ControlID= "tbRate " EventName= "TextChanged " />
</Triggers>
</asp:UpdatePanel>
</td>
<td align= "right " style= "width: 74px ">
</td>
<td style= "width: 100px ">
</td>
</tr>
</table>

</div>
<br />
<asp:Button ID= "btnAdd " runat= "server " CssClass= "Button " Height= "22px " Text= "确认 "
Width= "60px " OnClick= "btnAdd_Click " />
&nbsp; &nbsp;
<asp:Button ID= "btnBack " runat= "server " CausesValidation= "False " CssClass= "Button "
Height= "22px " Text= "返回 " Width= "60px " PostBackUrl= "~/Dep2Sheet/TicketIncomeList.aspx " />
</form>
</body>
</html>

[解决办法]
给楼主一个三个DropDownList联动的,慢慢爽啊~~

热点排行