I am using asp.net webforms for the first time and am trying to display the current date in the following form: Friday, July 13
<h3>Suggested reading for <% DateTime.Now.ToString(); %></h3>
However, this only displays
Suggested reading for
on my page.
I don't know if this helps, but here is some surrounding code:
<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="Fake_Coupon_Site.Account.Register" %>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<hgroup class="title">
<h1><%: Title %>.</h1>
<h2>Use the form below to create a new account.</h2>
<h3>Suggested reading for <% DateTime.Now.ToString(); %></h3>
</hgroup>
Try
<h3>Suggested reading for <%= DateTime.Now.ToString("dddd, MMMM dd") %></h3>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With