⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listboxautopostback.aspx

📁 asp.net技术内幕的书配源码
💻 ASPX
字号:
<%@ Page Language="C#"%>

<script Runat="Server">

string strBackGroundColor = "white";

void lstColors_SelectedIndexChanged( object s, EventArgs e ) {
  strBackGroundColor = lstColors.SelectedItem.Text;
}

</Script>

<html>
<head><title>ListboxAutoPostBack.aspx</title></head>
<body bgcolor="<%=strBackGroundColor%>">

<form Runat="Server">

<asp:ListBox
  ID="lstColors"
  AutoPostBack="True"
  OnSelectedIndexChanged="lstColors_SelectedIndexChanged"
  Runat="Server" >
  <asp:ListItem text="Red" />
  <asp:ListItem text="Green" />
  <asp:ListItem text="Blue" />
</asp:ListBox>

</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -