UpdatePanel Ajax

liliemumue Messages postés 51 Date d'inscription mardi 4 mars 2003 Statut Membre Dernière intervention 6 mars 2008 - 17 janv. 2007 à 21:33
lucasbfr Messages postés 2 Date d'inscription dimanche 5 septembre 2004 Statut Membre Dernière intervention 9 février 2007 - 9 févr. 2007 à 11:04
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">

&nbsp;<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">

&nbsp;<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">

&nbsp;<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">

&nbsp;<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

2 réponses

dragolidragon Messages postés 1 Date d'inscription dimanche 26 juin 2005 Statut Membre Dernière intervention 1 février 2007
1 févr. 2007 à 11:14
Ne serait-ce pas à cause de ça : AutoPostBack
="true" sur ton premier DropDownList???

J'ai un prob egalemnt avec des updatePanel qui update tous la page..
J'espère que dans ton cas ça résoudra le prob
0
lucasbfr Messages postés 2 Date d'inscription dimanche 5 septembre 2004 Statut Membre Dernière intervention 9 février 2007
9 févr. 2007 à 11:04
Essaie de virer l'autopostback et de mettre ca dans l'update panel:
 <Triggers>
       
</Triggers>
0
Rejoignez-nous