bonjour,
je realise une application web sous visual studio 2008 en asp.net vb. Dans une page de mon application je souhaite afficher la liste des localisations d'une entreprise (interieur exterieur parking ....) et dans une chekbox list je desire voir s'afficher le nom des secteur. par exemple si dans ma liste deroulante je selectionne "interieur" ma chek box list se rafraichi et m'azffiche que les secteur de l'interieur de l'entreprise.

y a t'il une personne qui peut m'aider voici le code de ma page asp ou l'on trouve le dropdownlist localisation, et la chekboxlist :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
 
<%@ Control
    Language="VB"
    AutoEventWireup="false"
    CodeFile="PDP.ascx.vb"
    Inherits="Modules_PDP" %>
<%@ Register
    Src="~/Modules/Document.ascx"
    TagName="Document"
    TagPrefix="uc" %>
<%@ Register
    Src="~/Modules/IntervenantPDP.ascx"
    TagName="IntervenantPDP"
    TagPrefix="uc" %>
<%@ Register
    Src="~/Modules/AvenantPDP.ascx"
    TagName="AvenantPDP"
    TagPrefix="uc" %>
<asp:Label
    ID="ParamidPDP"
    runat="server"
    Text="-1"
    Visible="false" />
<asp:DetailsView
    ID="DetailsViewPDP"
    runat="server"
    AutoGenerateRows="False"
    DataSourceID="SqlDataSourcePDP"
    Width="100%" 
    DataKeyNames="IdPDP">
    <Fields>
        <asp:TemplateField
            Visible="False">
            <ItemTemplate>
                <asp:Label
                    runat="server"
                    ID="LabelidDocument"
                    Text='<%# Eval("idDocument") %>' />
                <asp:Label
                    runat="server"
                    ID="LabelAllowEdit"
                    Text='<%# Eval("AllowEdit") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField
            HeaderText="Entreprise"
            SortExpression="Nom">
            <InsertItemTemplate>
                <asp:TextBox
                    ID="IdEntrepriseTextBox"
                    runat="server"
                    Text='<%# Bind("idEntreprise") %>'
                    Visible="false" />
                <asp:DropDownList
                    ID="DropDownListEntreprise"
                    runat="server"
                    AppendDataBoundItems="true"
                    AutoPostBack="true"
                    DataSourceID="SqlDataSourceEntreprise"
                    DataTextField="Nom"
                    DataValueField="idEntreprise"
                    OnSelectedIndexChanged="DropDownListEntreprise_SelectedIndexChanged"
                    Width="98%">
                    <asp:ListItem>
                    </asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator
                    ID="RequiredFieldValidator1"
                    runat="server"
                    ControlToValidate="DropDownListEntreprise"
                    Display="Dynamic"
                    ErrorMessage="Champ obligatoire" />
            </InsertItemTemplate>
            <HeaderStyle
                Width="180px" />
            <ItemTemplate>
                <asp:Label
                    ID="Label4"
                    runat="server"
                    Text='<%# Bind("Nom") %>' />
                <asp:Label
                    ID="LabelIdEntreprise"
                    runat="server"
                    Text='<%# Bind("idEntreprise") %>'
                    Visible="false" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField
            HeaderText="Intitule"
            SortExpression="Intitule">
            <EditItemTemplate>
                <asp:TextBox
                    ID="TextBox2"
                    runat="server"
                    MaxLength="1000"
                    Text='<%# Bind("Intitule") %>' />
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox
                    ID="TextBox2"
                    runat="server"
                    MaxLength="1000"
                    Text='<%# Bind("Intitule") %>'
                    Width="98%" />
            </InsertItemTemplate>
            <HeaderStyle
                Width="180px" />
            <ItemTemplate>
                <asp:Label
                    ID="Label2"
                    runat="server"
                    Text='<%# Bind("Intitule") %>'
                    Width="98%" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField
            HeaderText="Signature donneur d'ordre"
            SortExpression="DateSignatureDO">
            <EditItemTemplate>
                <asp:TextBox
                    ID="TextBox_DateSignatureDO"
                    runat="server"
                    type = "datetime"
                    CssClass="textcenter"
                    Text='<%# Bind("DateSignatureDO", "{0:d}") %>'
                    Width="80px" />
                <asp:ImageButton
                    ID="ImageButton_DateSignatureDO"
                    runat="server"
                    CausesValidation="false"
                    OnClick="ImageButton_Calendar_Click"
                    SkinID="Calendar" />
                <asp:Panel
                    ID="Panel_DateSignatureDO"
                    runat="server"
                    Visible="false"
                    Width="200px">
                    <div style="margin: 7px">
                        <asp:Calendar
                            ID="Calendar_DateSignatureDO"
                            runat="server"
                            OnSelectionChanged="Calendar_SelectionChanged">
                        </asp:Calendar>
                    </div>
                </asp:Panel>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox
                    ID="TextBox_DateSignatureDO"
                    runat="server"
                    CssClass="textcenter"
                   Text='<%# Bind("DateSignatureDO", "{0:d}") %>'
                    Width="80px" />
                <asp:ImageButton
                    ID="ImageButton_DateSignatureDO"
                    runat="server"
                    CausesValidation="false"
                    OnClick="ImageButton_Calendar_Click"
                    SkinID="Calendar" />
                <asp:Panel
                    ID="Panel_DateSignatureDO"
                    runat="server"
                    Visible="false"
                    Width="200px">
                    <div style="margin: 7px">
                        <asp:Calendar
                            ID="Calendar_DateSignatureDO"
                            runat="server"
                            OnSelectionChanged="Calendar_SelectionChanged">
                        </asp:Calendar>
                    </div>
                </asp:Panel>
            </InsertItemTemplate>
            <HeaderStyle
                Width="180px" />
            <ItemTemplate>
                <asp:Label
                    ID="Label5"
                    runat="server"
                    Text='<%# Bind("DateSignatureDO", "{0:d}") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField
            HeaderText="Signature entreprise exterieure"
            SortExpression="DateSignatureEE">
            <EditItemTemplate>
                <asp:TextBox
                    ID="TextBox_DateSignatureEE"
                    runat="server"
                    CssClass="textcenter"
                    type="datetime"
                     Text='<%# Bind("DateSignatureEE", "{0:d}") %>'
                    Width="80px" />
                <asp:ImageButton
                    ID="ImageButton_DateSignatureEE"
                    runat="server"
                    CausesValidation="false"
                    OnClick="ImageButton_Calendar_Click"
                    SkinID="Calendar" />
                <asp:Panel
                    ID="Panel_DateSignatureEE"
                    runat="server"
                    Visible="false"
                    Width="200px">
                    <div style="margin: 7px">
                        <asp:Calendar
                            ID="Calendar_DateSignatureEE"
                            runat="server"
                            OnSelectionChanged="Calendar_SelectionChanged">
                        </asp:Calendar>
                    </div>
                </asp:Panel>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox
                    ID="TextBox_DateSignatureEE"
                    runat="server"
                    CssClass="textcenter"
                    type="datetime"
                   Text='<%# Bind("DateSignatureEE", "{0:d}") %>'
                    Width="80px" />
                <asp:ImageButton
                    ID="ImageButton_DateSignatureEE"
                    runat="server"
                    CausesValidation="false"
                    OnClick="ImageButton_Calendar_Click"
                    SkinID="Calendar" />
                <asp:Panel
                    ID="Panel_DateSignatureEE"
                    runat="server"
                    Visible="false"
                    Width="200px">
                    <div style="margin: 7px">
                        <asp:Calendar
                            ID="Calendar_DateSignatureEE"
                            runat="server"
                            OnSelectionChanged="Calendar_SelectionChanged">
                        </asp:Calendar>
                    </div>
                </asp:Panel>
            </InsertItemTemplate>
            <HeaderStyle
                Width="180px" />
            <ItemTemplate>
                <asp:Label
                    ID="Label6"
                    runat="server"
                  Text='<%# Bind("DateSignatureEE", "{0:d}") %>' />
            </ItemTemplate>
        </asp:TemplateField>
    </Fields>
</asp:DetailsView>
<asp:DetailsView ID="DetailsView1" runat="server" Height="28px" Width="150px" 
    AutoGenerateRows="False" DataKeyNames="IdLocalisation" 
    DataSourceID="SqlDataSourceLocalisation">
    <Fields>
        <asp:TemplateField
            HeaderText="Localisation"
            SortExpression="Localisation">
            <InsertItemTemplate>
                <asp:TextBox
                    ID="IdLocalisationTextBox"
                    runat="server"
                    Text='<%# Bind("idLocalisation") %>'
                    Visible="false" />
                <asp:DropDownList
                    ID="DropDownListLocalisation"
                    runat="server"
                    AppendDataBoundItems="true"
                    AutoPostBack="true"
                    DataSourceID="SqlDataSourceLocalisation"
                    DataTextField="NomLocalisation"
                    DataValueField="idLocalisation"
                    OnSelectedIndexChanged="DropDownListLocalisation_SelectedIndexChanged"
                    Width="98%">
                    <asp:ListItem>
                    </asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator
                    ID="RequiredFieldValidator1"
                    runat="server"
                    ControlToValidate="DropDownListLocalisation"
                    Display="Dynamic"
                    ErrorMessage="Champ obligatoire" />
            </InsertItemTemplate>
            <HeaderStyle
                Width="180px" />
            <ItemTemplate>
                <asp:Label
                    ID="Label4"
                    runat="server"
                    Text='<%# Bind("NomLocalisation") %>' />
                <asp:Label
                    ID="LabelIdLocalisation"
                    runat="server"
                    Text='<%# Bind("idLocalisation") %>'
                    Visible="false" />
            </ItemTemplate>
        </asp:TemplateField>
    </Fields>
</asp:DetailsView>
<asp:Panel
    ID="PanelI"
    Width="100%"
    runat="server"
    visible="false">
    <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
        DataSourceID="SqlDataSourceChekBox" DataTextField="NomSecteur" 
        DataValueField="IdSecteur">
    </asp:CheckBoxList>
    <br />
    <table width="100%">
        <tr>
            <td style="text-align: center">
                <asp:LinkButton
                    Text="Enregistrer et compléter"
                    runat="server"
                    ID="LinkButtonINsertAndEdit" /></td>
        </tr>
    </table>
</asp:Panel>
<asp:Panel
    Width="100%"
    runat="server"
    ID="PanelRW"
    Visible="false">
    <br />
    <asp:Panel
        Width="100%"
        ID="Panel2"
        runat="server"
        GroupingText="Intervenants soumis au plan de prévention">
        <div class="panelcontent">
            <uc:IntervenantPDP
                ID="IntervenantPDPUC"
                runat="server" />
        </div>
    </asp:Panel>
    <br />
    <uc:AvenantPDP
        ID="AvenantPDPUC"
        runat="server" />
    <br />
    <asp:Panel 
        width="100%"
        ID="Panel3"
        runat="server"
        GroupingText="Exemplaire(s) du plan de prévention">
        <div class="panelcontent">
           <uc:Document
                ID="DocumentUC"
                runat="server" />
 
        </div>
    </asp:Panel>
</asp:Panel>
<asp:SqlDataSource
    ID="SqlDataSourcePDP"
    runat="server"
    ConnectionString="<%$ ConnectionStrings:PDP %>"
    DeleteCommand="DELETE FROM [PDP] WHERE [idPDP] = @idPDP"
    InsertCommand="INSERT INTO [PDP] ([idDocument], [idEntreprise], [IdDonneurOrdre],  [Intitule], [DateSignatureDO],[DateSignatureEE]) VALUES (@idDocument, @idEntreprise, @IdDonneurOrdre, @Intitule,@DateSignatureDO,@DateSignatureEE) SET @Identity = @@Identity"
    OnInserted="SqlDataSourcePDP_Inserted"
    OnInserting="SqlDataSourcePDP_Inserting"
    SelectCommand="SELECT PDP.idPDP, PDP.idDocument, PDP.Intitule,  PDP.DateSignatureDO, PDP.DateSignatureEE, PDP.idEntreprise, PDP.IdDonneurOrdRe, DonneurOrdre.Nom, Entreprise.Nom, CAST(1 AS bit) AS AllowEdit  FROM PDP INNER JOIN DonneurOrdre ON DonneurOrdre.idDonneurOrdre = PDP.idDonneurOrdre INNER JOIN Entreprise ON PDP.idEntreprise = Entreprise.idEntreprise  WHERE (PDP.idPDP = @idPDP) AND (DonneurOrdre.idDonneurOrdre = @UserID) OR (PDP.idPDP = @idPDP) AND (DonneurOrdre.idDonneurOrdre IS NULL) AND (@UserID >= 0) OR (PDP.idPDP = @idPDP)  AND (@UserID = 0) UNION SELECT PDP_1.idPDP, PDP_1.idDocument, PDP_1.Intitule, PDP_1.DateSignatureDO, PDP_1.DateSignatureEE, PDP_1.idEntreprise, Entreprise_1.Nom,PDP_1.IdDonneurOrdre, DonneurOrdre_1.Nom, CAST(0 AS bit) AS AllowEdit FROM PDP AS PDP_1 INNER JOIN Entreprise AS Entreprise_1 ON PDP_1.idEntreprise = Entreprise_1.idEntreprise INNER JOIN DonneurOrdre AS DonneurOrdre_1 ON PDP_1.IdDonneurOrdre = DonneurOrdre_1.IdDonneurOrdre WHERE (PDP_1.idPDP = @idPDP) AND (DonneurOrdre_1.idDonneurOrdre <>@UserID) AND (NOT (DonneurOrdre_1.idDonneurOrdre IS NULL)) AND (@UserID <> 0) OR (PDP_1.idPDP = @idPDP)  AND (@UserID < 0) "
    UpdateCommand="UPDATE [PDP] SET [idEntreprise] = @idEntreprise, [IdDonneurOrdre] = @IdDonneurOrdre, [Intitule] = @Intitule, [DateSignatureDO] = @DateSignatureDO, [DateSignatureEE] = @DateSignatureEE WHERE [idPDP] = @idPDP">
    <DeleteParameters>
        <asp:Parameter
            Name="idPDP"
            Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter
            Name="idEntreprise"
            Type="Int32" />
        <asp:Parameter
            Name="IdDonneurOrdre" 
            Type="Int32" />
        <asp:Parameter
            Name="Intitule"
            Type="char" />
        <asp:Parameter 
            Name="DateSignatureDO"
            Type="DateTime" />
        <asp:Parameter
            Name="DateSignatureEE"
            Type="DateTime" />
        <asp:Parameter
            Name="idPDP"
            Type="Int32" />
    </UpdateParameters>
    <InsertParameters>
        <asp:Parameter
            Name="idDocument"
            Type="Int32" />
        <asp:Parameter
            Name="idEntreprise"
            Type="Int32" />
        <asp:Parameter
            Name="IdDonneurOrdre" 
            Type="Int32" />
        <asp:Parameter
            Name="Intitule"
            Type="string" />
        <asp:Parameter
            Name="DateSignatureDO"
            Type="DateTime" />
        <asp:Parameter
            Name="DateSignatureEE"
            Type="DateTime" />
        <asp:Parameter
            Name="Identity" 
            Direction="Output"
            Type="int32" />
    </InsertParameters>
    <SelectParameters>
        <asp:ControlParameter
            ControlID="ParamidPDP"
            DefaultValue="-1"
            Name="idPDP"
            PropertyName="Text"
            Type="Int32" />
        <asp:SessionParameter
            Name="UserID"
            SessionField="UserID"
            DefaultValue="-1" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource
    ID="SqlDataSourceEntreprise"
    runat="server"
    ConnectionString="<%$ ConnectionStrings:PDP %>"
    SelectCommand="SELECT [Nom], [idEntreprise] FROM [Entreprise] ORDER BY [Nom]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSourceLocalisation" runat="server" 
    ConnectionString="<%$ ConnectionStrings:PDP %>" 
    SelectCommand="SELECT [IdLocalisation], [NomLocalisation] FROM [Localisation] ORDER BY [NomLocalisation]">
</asp:SqlDataSource>
 
<asp:SqlDataSource ID="SqlDataSourceChekBox" runat="server" 
    ConnectionString="<%$ ConnectionStrings:PDP %>" SelectCommand="select Secteur.IdSecteur,Secteur.NomSecteur
From Secteur
INNER JOIN InterPDP on InterPDP.IdSecteur = Secteur.IdSecteur
where IdLocalisation = @IdLOcalisation">
    <SelectParameters>
        <asp:Parameter Name="IdLOcalisation" />
    </SelectParameters>
</asp:SqlDataSource>
et voici le code behind de ma page :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
 
 
Partial Class Modules_PDP
    Inherits System.Web.UI.UserControl
 
    Public Function InitMode(ByVal Mode As FormViewMode, Optional ByVal idPDP As String = "-1") As Boolean
        InitMode = True
        On Error Resume Next
        ViewState.Clear()
 
        If IsNumeric(idPDP) Then ParamidPDP.Text = idPDP
        DetailsViewPDP.ChangeMode(Mode)
        DetailsViewPDP.DataBind()
 
        InitMode = (DetailsViewPDP.DataItemCount > 0 Or Mode = DetailsViewMode.Insert)
        If InitMode Then
            Dim idDocument As String
            Dim AllowEdit As Boolean
 
            idDocument = CType(DetailsViewPDP.FindControl("LabelidDocument"), Label).Text
            AllowEdit = CBool(CType(DetailsViewPDP.FindControl("LabelAllowEdit"), Label).Text)
 
            If Not AllowEdit And Mode = FormViewMode.Edit Then
                InitMode = InitMode(FormViewMode.ReadOnly, idPDP)
            Else
                Select Case DetailsViewPDP.CurrentMode
                    Case FormViewMode.ReadOnly
                        PanelRW.Visible = True
                        PanelI.Visible = False
                        IntervenantPDPUC.InitMode(FormViewMode.ReadOnly, idPDP)
 
                        DocumentUC.InitMode(FormViewMode.ReadOnly, idDocument)
                        AvenantPDPUC.InitMode(FormViewMode.ReadOnly, idPDP)
                    Case FormViewMode.Edit
                        PanelRW.Visible = True
                        PanelI.Visible = False
                        IntervenantPDPUC.InitMode(FormViewMode.Edit, idPDP)
                        DocumentUC.InitMode(FormViewMode.Edit, idDocument)
                        AvenantPDPUC.InitMode(FormViewMode.Edit, idPDP)
                    Case DetailsViewMode.Insert
                        PanelRW.Visible = False
                        PanelI.Visible = True
                End Select
            End If
        Else
            InitMode = (DetailsViewPDP.DataItemCount > 0)
        End If
 
    End Function
 
    Public Function SaveAndGetID() As String
 
        If DetailsViewPDP.CurrentMode = FormViewMode.Edit Then
            DetailsViewPDP.UpdateItem(False)
        ElseIf DetailsViewPDP.CurrentMode = FormViewMode.Insert Then
            DetailsViewPDP.InsertItem(False)
        End If
        Try
            SaveAndGetID = CInt(ParamidPDP.Text)
        Catch ex As Exception
            SaveAndGetID = -1
        End Try
    End Function
 
    Public Function CurrentMode() As FormViewMode
        CurrentMode = DetailsViewPDP.CurrentMode
    End Function
 
    Public Shared Sub DeleteID(ByVal idPDP As String)
        Dim idDocument As String
        idDocument = ExecuteSQL("Select idDocument From PDP WHERE idPDP = " & idPDP).ToString
        Modules_Document.DeleteID(idDocument)
        ExecuteSQL("Delete From PDP where idPDP = " & idPDP)
    End Sub
 
    Protected Sub DropDownListEntreprise_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim txtEntreprise As TextBox = CType(DetailsViewPDP.FindControl("IdEntrepriseTextBox"), TextBox)
        Dim ddlEntreprise As DropDownList = CType(DetailsViewPDP.FindControl("DropDownListEntreprise"), DropDownList)
        'Dim NumTextBox As TextBox = CType(DetailsViewPDP.FindControl("TextBoxNumero"), TextBox)
        txtEntreprise.Text = ddlEntreprise.SelectedValue
        'If NumTextBox.Text = "" Then ImageButtonFindNumber_Click(Nothing, Nothing)
    End Sub
    Protected Sub DropDownListLocalisation_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim txtLocalisation As TextBox = CType(DetailsViewPDP.FindControl("IdLocalisationTextBox"), TextBox)
        Dim ddlLocalisation As DropDownList = CType(DetailsViewPDP.FindControl("DropDownListLocalisation"), DropDownList)
 
        txtLocalisation.Text = ddlLocalisation.SelectedValue
        CheckBoxList1.ClearSelection()
    End Sub
 
    Protected Sub SqlDataSourcePDP_Inserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
        ParamidPDP.Text = e.Command.Parameters("@Identity").Value
    End Sub
 
    Protected Sub SqlDataSourcePDP_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs)
        e.Command.Parameters("@idDocument").Value = Outils.ExecuteSQL("Insert Into Document (Type) values ('PDP') Select @@Identity").ToString
    End Sub
 
    Public Sub SetEntreprise(ByVal idEntreprise As Integer)
        Dim ddlEntreprise As DropDownList = CType(DetailsViewPDP.FindControl("DropDownListEntreprise"), DropDownList)
        ddlEntreprise.SelectedValue = idEntreprise.ToString
        DropDownListEntreprise_SelectedIndexChanged(ddlEntreprise, Nothing)
        ddlEntreprise.Enabled = False
    End Sub
    Public Sub SetLocalisation(ByVal idLocalisation As Integer)
        Dim ddlLocalisation As DropDownList = CType(DetailsViewPDP.FindControl("DropDownListLocalisation"), DropDownList)
        ddlLocalisation.SelectedValue = idLocalisation.ToString
        DropDownListLocalisation_SelectedIndexChanged(ddlLocalisation, Nothing)
        ddlLocalisation.Enabled = False
    End Sub
 
    ' Sub ImageButtonFindNumber_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
    'Dim idEntreprise As Object
    '
    '   Try
    '      idEntreprise = CType(DetailsViewPDP.FindControl("DropDownListEntreprise"), DropDownList).SelectedValue
    '
    '   Catch ex As Exception
    '      idEntreprise = CType(DetailsViewPDP.FindControl("LabelIdEntreprise"), Label).Text
    '
    '   End Try
    'Dim NumTextBox As TextBox = CType(DetailsViewPDP.FindControl("TextBoxNumero"), TextBox)
    'Dim num As Object = Nothing
    '   If Not IsNothing(idEntreprise) Then
    '      num = ExecuteSQL("Select max(Numero) From PDP Where idEntreprise = " & idEntreprise)
    ' End If
    'If Not IsNumeric(num) Then
    '   num = ExecuteSQL("Select max(Numero) From PDP")
    '  If IsNothing(num) Then
    '     num = "1"
    'ElseIf IsNumeric(num) Then
    '   num = CDec(num) + 1
    ' Else
    '    num = "(" & num.ToString & ")"
    'End If
    'End If
    'NumTextBox.Text = num.ToString
    'End Sub
 
 
    Sub ImageButton_Calendar_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
        Outils.ImageButton_Calendar_Click(sender, e)
    End Sub
 
    Protected Sub Calendar_Init(ByVal sender As Object, ByVal e As System.EventArgs)
        Outils.Calendar_Init(sender, e)
    End Sub
 
    Protected Sub Calendar_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Outils.Calendar_SelectionChanged(sender, e)
    End Sub
 
    Protected Sub LinkButtonINsertAndEdit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButtonINsertAndEdit.Click
        InitMode(FormViewMode.Edit, SaveAndGetID())
        PanelRW.Visible = "true"
    End Sub
 
    Protected Sub DetailsViewPDP_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewPageEventArgs) Handles DetailsViewPDP.PageIndexChanging
 
    End Sub
End Class
merci pour votre aide,
cordialement