Comment faire 2 ou 3 listbox imbriqués?
Bonjour,
J'essaie sans grand succès d'afficher deux listboxs imbriqués.
Le premier contient la région et est le résultat d'une procédure stockée sans paramètre en entrée.
Pour le second, je voudrais qu'il affiche la sous liste de région (pays) en faisant appel à uen procédure stckée qui a en entré l'id de la région.
Je suis débutant sur asp.net et voilà ce que j'ai fait
Code:
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
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="brouillon.aspx.cs" Inherits="parea.pages.brouillon" %>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:maDBConnectionString %>"
SelectCommand="ps_listRegion" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
</div>
<asp:ListBox ID="ListBoxRegion" runat="server" DataSourceID="SqlDataSource1"
DataTextField="region" DataValueField="id_region" Rows="1" ></asp:ListBox>
<asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="country" DataValueField="id_country" Rows="1" ></asp:ListBox>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:maDBConnectionString %>"
SelectCommand="ps_listCountryByRegion" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:FormParameter DefaultValue="1" FormField="ListBoxRegion" Name="id_region"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</form>
</body>
</html> |
MErciiiiiiiii d'avance...