Bonjour
Alors je vais expose rmon probleme.
J'ai un formulaire dans lequel j'ai une DropDownList et troie panel à Visible =false.
Lors de la selection d'un Item de la DropDownList , le panel Correspondant apparait à Visible = True. Seulement toute ma page se recharge alors j'ai voulu utiliser ajax et le Update Panel, mais ca recharge toujours ma page entièrement.
voici le Code :
<tr>
<td
style="width: 109px"><asp:Label
ID="Label3"
runat="server"
Text="Type *"
Width="68px"></asp:Label></td>
<td
colspan="3">
<asp:DropDownList
ID="DropDownList_typeAdresse"
Width="230px"
OnSelectedIndexChanged="DropDownList_typeAdresse_SelectedIndexChanged"
runat="server"
AutoPostBack="true"></asp:DropDownList></td>
</tr>
<asp:UpdatePanel
ID="UpdatePanel1"
UpdateMode="conditional"
runat="server">
<ContentTemplate>
<asp:Panel
ID="PanelTypeMusique"
runat="server"
Width="450px">
<table
class="forminscription"
border="0"
style="font-size: 12px; font-family: Arial;font-style: italic; font-weight: bold">
<tr>
<td>Genre /Cat‚gorie
</td>
<td
colspan="3">
<asp:ListBox
ID="ListBoxMusique"
runat="server"
SelectionMode="Multiple"
Width="230px"
DataSourceID="SqlDataSourceMusique"
DataTextField="MUS_NOM"
DataValueField="MUS_ID">
</asp:ListBox>
<asp:SqlDataSource
ID="SqlDataSourceMusique"
runat="server"
ConnectionString="<%$ ConnectionStrings:cytadinbaseConnectionString %>
"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT MUS_NOM, MUS_ID FROM Type_Musique ORDER BY MUS_NOM">
</asp:SqlDataSource>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel
ID="PanelTypeBar"
runat="server"
Width="450px">
<table
class="forminscription"
border="0"
style="font-size: 12px; font-family: Arial;font-style: italic; font-weight: bold">
<tr>
<td>Genre /Cat‚gorie
</td>
<td
colspan="3">
<asp:ListBox
ID="ListBoxBar"
runat="server"
SelectionMode="Multiple"
Width="230px"
DataSourceID="SqlDataSourceTypeBar"
DataTextField="BAR_NOM"
DataValueField="BAR_ID">
</asp:ListBox>
<asp:SqlDataSource
ID="SqlDataSourceTypeBar"
runat="server"
ConnectionString="<%$ ConnectionStrings:cytadinbaseConnectionString %>
"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT BAR_ID, BAR_NOM FROM Type_Bar ORDER BY BAR_NOM">
</asp:SqlDataSource>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel
ID="PanelCuisine"
runat="server"
Width="450px">
<table
class="forminscription"
border="0"
style="font-size: 12px; font-family: Arial;font-style: italic; font-weight: bold">
<tr>
<td>Genre /Cat‚gorie
</td>
<td
colspan="3">
<asp:ListBox
ID="ListBoxCuisine"
runat="server"
SelectionMode="Multiple"
Width="230px"
DataSourceID="SqlDataSourceTypeCuisine"
DataTextField="TYPE_CUISINE_NOM"
DataValueField="TYPE_CUISINE_ID">
</asp:ListBox>
<asp:SqlDataSource
ID="SqlDataSourceTypeCuisine"
runat="server"
ConnectionString="<%$ ConnectionStrings:cytadinbaseConnectionString %>
"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT TYPE_CUISINE_ID, TYPE_CUISINE_NOM FROM Type_Cuisine ORDER BY TYPE_CUISINE_NOM">
</asp:SqlDataSource>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel
ID="PanelShopping"
runat="server"
Width="450px">
<table
class="forminscription"
border="0"
style="font-size: 12px; font-family: Arial;font-style: italic; font-weight: bold">
<tr>
<td>Genre /Cat‚gorie
</td>
<td
colspan="3">
<asp:ListBox
ID="ListBoxShopping"
runat="server"
SelectionMode="single"
Width="230px"
DataSourceID="SqlDataSourceTypeShop"
DataTextField="SPE_SHOPPING"
DataValueField="SPE_SHOPPING_ID">
</asp:ListBox>
<asp:SqlDataSource
ID="SqlDataSourceTypeShop"
runat="server"
ConnectionString="<%$ ConnectionStrings:cytadinbaseConnectionString %>
"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT SPE_SHOPPING_ID, SPE_SHOPPING FROM Adresse_Spe_Shopping ORDER BY SPE_SHOPPING">
</asp:SqlDataSource>
</td></tr>
</table>
</asp:Panel>
</ContentTemplate>
<Triggers> <asp:AsyncPostBackTrigger
ControlID="DropDownList_typeAdresse"
EventName="SelectedIndex"
/></Triggers>
</asp:UpdatePanel>
Avez vous une idée ? Merci
Afficher la suite