Voilà je sais qu'en Csharp pour prendre al date du jour c'est DateTime.Today
mais voilà j'ai une page, avec Sql data source qui point sur une stored procedure qui insert dans ma table news

donc j'ai une formview qui contient donc le champs a remplis mais je souhaiterais que lorsqu'on tombe sur cette page le champs date soit remplis avec la date du jours.

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
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="EditionNews.aspx.cs" Inherits="EditionNews" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        InsertCommand="ajouterNews" InsertCommandType="StoredProcedure" SelectCommand="SELECT news.* FROM news">
        <InsertParameters>
            <asp:Parameter Name="titre" Type="String" />
            <asp:Parameter Name="commentaire" Type="String" />
            <asp:Parameter Name="date" Type="DateTime" />
            <asp:Parameter Name="auteur" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataSourceID="SqlDataSource1" Height="107px" Width="184px">
        <InsertItemTemplate>
            titre:
            <br />
            <asp:TextBox ID="titreTextBox" runat="server" Text='<%# Bind("titre") %>' Width="244px"></asp:TextBox><br />
            commentaire:
            <asp:TextBox ID="commentaireTextBox" runat="server" Text='<%# Bind("commentaire") %>' Height="79px" Width="245px"></asp:TextBox><br />
            date:
            <br />
            <asp:TextBox ID="dateTextBox" runat="server" Text='<%# Bind("date", "{0:d}") %>' OnTextChanged="dateTextBox_TextChanged"></asp:TextBox><br />
            auteur:<br />
            <asp:TextBox ID="auteurTextBox" runat="server" Text='<%# Bind("auteur") %>' Width="242px"></asp:TextBox><br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                Text="Insert">
            </asp:LinkButton>
            <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel">
            </asp:LinkButton>
        </InsertItemTemplate>
    </asp:FormView>
</asp:Content>
Merci pour le coup de mains.