2010-10-21 3 views
0

J'ai cette page appelée profil. L'heure est incorrecte lorsque je lance l'application. Quelqu'un peut-il m'aider à corriger l'heure au bon format?profils asp.net

<asp:LoginView ID="LoginView1" runat="server"> 
     <AnonymousTemplate> 
      <strong>To View Profiles You Have to Register Or </strong> <asp:HyperLink ID="HyperLink1" runat="server" 
       NavigateUrl="~/Account/Login.aspx" Font-Size="Large" Font-Bold="True">Login</asp:HyperLink> 
     </AnonymousTemplate> 
     <LoggedInTemplate> 
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
       ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
       SelectCommand="SELECT [UserId], [UserName], [LastActivityDate] FROM [vw_aspnet_Users]"></asp:SqlDataSource><br /> 
       <div align="center"> 
      <h1 style="text-align:center; 
    font-size: x-large; 
    font-weight: bold; 
    border: solid 2px gold; 
    background-color: #ffc; 
    padding: 5px; 
    margin-bottom: 15px; 
    width: 66%;"> 
       Members Of Living To Please The Lord World(Ephesians 5:10) ! 
      </h1> 
     </div><br /> 
     <div style="padding-left:10px" align="center"> 
      <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"> 
      <ItemTemplate> 
      <a id="A1" href=<%#"~/Profiles.aspx?UserId=" & Eval("UserId").ToString %> runat="server" style="font-size:large;"> 
      <%#Eval("UserName") %> 
      </a>&nbsp;&nbsp;&nbsp;&nbsp; 
      Last Visted On : <%# Eval("LastActivityDate")%> 
      <br /> 
      </ItemTemplate> 
      </asp:Repeater> 
      </div> 
     </LoggedInTemplate> 
    </asp:LoginView> 

Répondre

0

Ok, si cela est vraiment MVC, il devrait ressembler à ceci: <% = Model.LastActivityDate.ToShortDateString()%> Mais je pense que vous avez ASP.NET Forms ici.

+0

Je l'ai compris moi-même. J'étais censé ajouter Now(). ToString(). C'est le bon code: Last Visted On: <% # Eval ("LastActivityDate"). Maintenant(). ToString()%> – onfire4JesusCollins