ASP

本类阅读TOP10

·asp常用数据库连接方法和技巧
·无组件生成BMP验证码
·一些常用的辅助代码 (网络收藏)
·JavaScript实现的数据表格:冻结列、调整列宽和客户端排序
·VisualStudio.NET_2003及其 MSDN 下载地址
·ASP模拟MVC模式编程
·图片以二进制流输出到网页
·MD5加密算法 ASP版
·ASP.NET编程中的十大技巧
·改进 ASP 的字符串处理性能

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
[我的ASP.net学习历程]DropDownList

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

<%@ Page Language="C#" AutoEventWireup="True" Debug="true" %>
<Script language="C#" runat="server">
void Page_Load(Object Sender,EventArgs e){
 if (!IsPostBack){
  Hashtable Htb=new Hashtable();
  Htb.Add("1234","MicroSoft");
  Htb.Add("3210","Sum");
  DownList_2.DataSource=Htb;
  DownList_2.DataValueField="Key";
  DownList_2.DataTextField="Value";
  DownList_2.DataBind();
  }
 else{
  Label_1.Text="DownList_1 value is:"+DownList_1.SelectedItem.Value+"<br>";
  Label_2.Text="DownList_2 value is:"+DownList_2.SelectedItem.Value+"<br>";
 }
}
</Script>
<form id="Form_1" runat="server">
DownList_1:
 <asp:dropdownlist ID="DownList_1" AutoPostBack="true" runat="server">
  <asp:listitem Value="Default" Text="Default Colors"/>
  <asp:listitem Value="Bright" Text="Bright Colors"/>
  <asp:listitem Value="Dark" Text="Dark Colors"/>
  <asp:listitem Value="Mono" Text="Black and White"/>
 </asp:dropdownlist><br>
DownList_2:
 <asp:dropdownlist ID="DownList_2" AutoPostBack="true" runat="server"></asp:dropdownlist>
</form>
<asp:label ID="Label_1" runat="server"></asp:label>
<asp:label ID="Label_2" runat="server"></asp:label>


相关文章

相关软件