asp.net checkboxlist scrollbar
checkboxlist-scrollbar.aspx
<%@ Page Language="C#" AutoEventWireup="true"%>
<!DOCTYPE html>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
string[] birds = {
"Ribbon-tailed Astrapia",
"Superb Bird of Paradise",
"Paradise Riflebird",
"King Bird of Paradise",
"Jacky Winter",
"Hypocolius",
"Cedar Waxwing",
"Black-capped Chickadee"
};
CheckBoxList1.DataSource = birds;
CheckBoxList1.DataBind();
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>asp.net checkboxlist scrollbar</title>
<style type="text/css">
.block {
height:150px;
width:200px;
border:1px solid aliceblue;
overflow-y:scroll;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:MidnightBlue; font-style:italic;">
asp.net example - checkboxlist scrollbar
</h2>
<hr width="550" align="left" color="Gainsboro" />
<br /><br />
<div class="block">
<asp:CheckBoxList
ID="CheckBoxList1"
runat="server"
RepeatLayout="Table"
>
</asp:CheckBoxList>
</div>
</div>
</form>
</body>
</html>
- How to add an onClick event to a Label
- How to create a rounded corners DropDownList
- How to change DropDownList selected item text and background color
- How to select all items in a CheckBoxList
- How to retrieve multiple selected values from CheckBoxList
- How to create a horizontal CheckBoxList
- How to get CheckBoxList checked items
- How to set default checked items in CheckBoxList
- How to get CheckBoxList selected values using Linq
- How to set the maximum limit of selection in a CheckBoxList