<%@ Page Language=”C#” AutoEventWireup=”true” CodeBehind=”Default.aspx.cs” Inherits=”WebApplication1._Default” %>
<!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>test</title>
</head>
<body>
<script language=”c#” runat=”server”>
void Page_Load(Object sender, EventArgs E) {
if (Page.IsPostBack == false)
{
for (int i = 1; i < 15; i++)
{
DropDownLis.Items.Add(“test”+i.ToString());
}
DropDownLis.SelectedIndex = 0;
}
else {
}
}
void DropDownLisOnSelectedindexChange(Object sender, EventArgs E)
{
Label1.Text = DropDownLis.Text;
}
void Button1OnClick(Object sender, EventArgs E) {
Label1.Text = DropDownLis.Text;
}
</script>
<form id=”form1” runat=”server”>
<div>
<asp:DropDownList ID=”DropDownLis” runat=”server”>
</asp:DropDownList>
<asp:Button ID=”Button1” runat=”server” Text=”Button” /><img alt=”” src=”http://localhost:59197/images/test.jpg” />
<asp:TextBox ID=”TextBox1” runat=”server”></asp:TextBox>
<asp:Label ID=”Label1” runat=”server” Text=”rien”></asp:Label>
</div>
</form>
</body>
</html>
Tapez pas ^^