1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| <table>
<tr>
<td>
<asp:ListBox ID="ListBox1" runat="server" Width="200px">
</asp:ListBox>
<cc1:ListSearchExtender ID="ListSearchExtender1" runat="server" TargetControlID="ListBox1">
</cc1:ListSearchExtender>
</td>
<td>
<center>
<input id="Button4" type="button" value="Ajouter >>>" onclick="Deplacer(this.form.ctl00_Corps_ListBox1,this.form.ctl00_Corps_ListBox2)" />
<br /><br />
<input id="Button3" type="button" value="<<< Enlever" onclick="Deplacer(this.form.ctl00_Corps_ListBox2,this.form.ctl00_Corps_ListBox1)" />
</center>
</td>
<td>
<asp:ListBox ID="ListBox2" runat="server" Width="200px">
</asp:ListBox>
</td>
</tr>
</table>
protected void liste_formateur()
{
query = "SELECT * FROM vue_formateur WHERE ind_activer=1";
SqlConnection cnx = (SqlConnection)Session["oConnection"];
try
{
SqlCommand myCommand = new SqlCommand(query, cnx);
reader = myCommand.ExecuteReader();
while (reader.Read())
{
ListItem item = new ListItem(reader["ind_nom"].ToString()+" "+reader["ind_prenom"].ToString(),reader["ind_code"].ToString());
ListBox1.Items.Add(item);
}
}
catch (System.Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
finally
{
reader.Close();
}
} |