Study the example and adapt:
the aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default32.aspx.cs" Inherits="Default32" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList id="drop1" runat="server"
onselectedindexchanged="drop1_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Value="value1">Item 1</asp:ListItem>
<asp:ListItem Value="value2">Item 2</asp:ListItem>
<asp:ListItem Value="value3">Item 3</asp:ListItem>
<asp:ListItem Value="value4">Item 5</asp:ListItem>
<asp:ListItem Value="value5">Item 6</asp:ListItem>
</asp:DropDownList>
<div id="myDiv" runat="server">
</div>
</div>
</form>
</body>
</html>
the code behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default32 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void drop1_SelectedIndexChanged(object sender, EventArgs e)
{
myDiv.InnerHtml = myDiv.InnerHtml + "<br />" + drop1.SelectedValue;
}
}