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
| <asp:FormView runat="server" id="FormView1" DataSourceID="SqlDataSource1" DataKeyNames="id,auteur_id1" CssClass="formulaire_edition">
<EditItemTemplate>
<label>Titre</label>
<asp:TextBox Text='<%# Bind("titre") %>' runat="server" id="titreTextBox" />
<br />
<label>Auteur</label>
<asp:DropDownList runat="server" id="DropDownList1" DataTextField="nom" DataSourceID="SqlDataSource2" DataValueField="auteur_id">
</asp:DropDownList>
<br />
<label>Date</label>
<asp:TextBox Text='<%# Bind("date") %>' runat="server" id="dateTextBox" />
<br />
<label>Introduction</label>
<asp:TextBox Text='<%# Bind("chapo") %>' runat="server" id="chapoTextBox" TextMode="Multiline" />
<br />
<label>Texte</label>
<asp:TextBox Text='<%# Bind("texte") %>' runat="server" id="texteTextBox" TextMode="Multiline" />
<br />
<label>Lien</label>
<asp:TextBox Text='<%# Bind("lien") %>' runat="server" id="lienTextBox" />
<br />
<label>URL du lien associé</label>
<asp:TextBox Text='<%# Bind("lien_url") %>' runat="server" id="lien_urlTextBox" />
<br />
<asp:LinkButton runat="server" Text="Mettre à jour" CommandName="Update" id="UpdateButton" CausesValidation="True" />
<asp:LinkButton runat="server" Text="Annuler" CommandName="Cancel" id="UpdateCancelButton" CausesValidation="False" />
</EditItemTemplate>
<InsertItemTemplate>
titre:
<asp:TextBox Text='<%# Bind("titre") %>' runat="server" id="titreTextBox" />
<br />
auteur_id:
<asp:TextBox Text='<%# Bind("auteur_id") %>' runat="server" id="auteur_idTextBox" />
<br />
date:
<asp:TextBox Text='<%# Bind("date") %>' runat="server" id="dateTextBox" />
<br />
texte:
<asp:TextBox Text='<%# Bind("texte") %>' runat="server" id="texteTextBox" />
<br />
chapo:
<asp:TextBox Text='<%# Bind("chapo") %>' runat="server" id="chapoTextBox" />
<br />
lien:
<asp:TextBox Text='<%# Bind("lien") %>' runat="server" id="lienTextBox" />
<br />
lien_url:
<asp:TextBox Text='<%# Bind("lien_url") %>' runat="server" id="lien_urlTextBox" />
<br />
nom:
<asp:TextBox Text='<%# Bind("nom") %>' runat="server" id="nomTextBox" />
<br />
<asp:LinkButton runat="server" Text="Insérer" CommandName="Insert" id="InsertButton" CausesValidation="True" />
<asp:LinkButton runat="server" Text="Annuler" CommandName="Cancel" id="InsertCancelButton" CausesValidation="False" />
</InsertItemTemplate>
<ItemTemplate>
<strong>
<asp:Label Text='<%# Bind("titre") %>' runat="server" id="titreLabel" />
</strong>
<br />
<asp:Label Text='<%# Bind("chapo") %>' runat="server" id="chapoLabel" />
<hr />
<asp:Label Text='<%# Bind("texte") %>' runat="server" id="texteLabel" />
<br />
<asp:HyperLink runat="server" id="Lien_associe" Text='<%# Eval("lien") %>' NavigateUrl='<%# Eval("lien_url") %>' Target="_blank">
</asp:HyperLink>
<br />
Date:
<asp:Label Text='<%# Bind("date") %>' runat="server" id="dateLabel" />
<br />
<a href=""> </a><br />
<asp:LinkButton runat="server" Text="Modifier" CommandName="Edit" id="EditButton" CausesValidation="False" />
</ItemTemplate>
<HeaderTemplate>
<h2>Gestion des actualités</h2>
</HeaderTemplate>
</asp:FormView>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:Intranet_local %>" SelectCommand="SELECT * FROM [Actualites],[Auteurs] WHERE ([Actualites].[id] = @id AND [Auteurs].[auteur_id] = [Actualites].[auteur_id])" UpdateCommand="UPDATE [Actualites] SET [titre]=@titre,[texte]=@texte,[chapo]=@chapo,[lien]=@lien,[lien_url]=@lien_url,[auteur_id]=@auteur_id WHERE [id]=@id">
<UpdateParameters>
<asp:parameter Name="titre" />
<asp:parameter Name="auteur_id" />
<asp:parameter Name="id" />
</UpdateParameters>
<SelectParameters>
<asp:querystringparameter Type="Int32" Name="id" QueryStringField="id" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource runat="server" ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:Intranet_local %>" SelectCommand="SELECT * FROM [Auteurs]">
</asp:SqlDataSource> |
Partager