Bonjour
J'ai construit une page par du code
Code ASP : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 <asp:LinkButton ID="LinkButton1" runat="server" Visible="false">LinkButton</asp:LinkButton> <table id="MonTableau" runat="server" style="width: 100%;"> </table>
Code VB.Net : 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 Dim bSql As String = "select * from v_article" ExecuteLMD(bSql) MonTableau.Rows.Clear() Dim rn As Integer Dim colonne As Integer Dim Maligne As New HtmlTableRow() Maligne.Height = "280" Do Until rn > bTab.Rows.Count - 1 Dim MaCase As New HtmlTableCell() MaCase.Width = "23.5%" Maligne.Cells.Add(MaCase) MaCase.Width = "2%" Maligne.Cells.Add(MaCase) Dim DivImage As New HtmlGenericControl("div") DivImage.Style(HtmlTextWriterStyle.TextAlign) = "Center" Dim ImageArticle As New Image With ImageArticle .ImageUrl = bTab.Rows(rn).Item("LienPhoto").ToString .Width = "150" .Height = "150" End With DivImage.Controls.Add(ImageArticle) MaCase.Controls.Add(DivImage) Dim DivValeur As New HtmlGenericControl("div") With DivValeur .Style(HtmlTextWriterStyle.TextAlign) = "Center" .InnerText = bTab.Rows(rn).Item("Valeur").ToString End With MaCase.Controls.Add(DivValeur) Dim DivPrixUnite As New HtmlGenericControl("div") With DivPrixUnite .Style(HtmlTextWriterStyle.TextAlign) = "Center" .InnerText = IIf(bTab.Rows(rn).Item("PuGros").ToString = Int(bTab.Rows(rn).Item("PuGros")), FormatNumber(bTab.Rows(rn).Item("PuGros").ToString, 0), FormatNumber(bTab.Rows(rn).Item("PuGros").ToString, 2)) & " / " & bTab.Rows(rn).Item("UniteGros").ToString End With MaCase.Controls.Add(DivPrixUnite) Dim DivPasserCommande As New HtmlGenericControl("div") DivPasserCommande.Style(HtmlTextWriterStyle.TextAlign) = "Center" Dim PasserCommande As New LinkButton With PasserCommande .ID = "lk_" & bTab.Rows(rn).Item("Id").ToString CommandeArticle = PasserCommande AddHandler PasserCommande.Click, AddressOf LinkButton1_Click .Text = "Passer commande" End With DivPasserCommande.Controls.Add(PasserCommande) MaCase.Controls.Add(DivPasserCommande) If colonne = 4 Then colonne = 0 Maligne = New HtmlTableRow() End If colonne = colonne + 1 rn = rn + 1 MonTableau.Rows.Add(Maligne) Loop bTab = Nothing
Tout marche à merveille. Le principe est de créer une page d'exposition des articles avec un linkbutton "Passer commande" pour chaque article. Son "ID" est "lk_" suivi de l'identifiant de l'article. Si l'utilisateur clique sur le bouton, l'article doit être appelé dans une page popup.
La problématique, c'est de récupérer le ID de chaque linkbutton "Passer commande".
S'il y a aussi une autre méthode pour arriver au même résultat, je suis preneur.
Partager