Solved

Grid veiw format a date so it shows the month name

Posted on 2006-06-30
4
360 Views
Last Modified: 2008-03-17

Hi all,
I have a grid view which displays a date from a database. I have the date in the dd-mm-yyyy format by putting this code in the source of the aspx page:
DataFormatString="{0:dd-M-yyyy}" HtmlEncode="False"

Is there a format i can use to get the following:
2 March 2006

instead of 2/3/2006?

Cant find the right info on this as there so much on it!
Cheers
D
0
Comment
Question by:CoreSupport
  • 3
4 Comments
 
LVL 19

Accepted Solution

by:
DreamMaster earned 125 total points
ID: 17016454
How about changing the field to a Templatefield...like so:

<asp :TemplateField HeaderText=“CreationDate” >
   <edititemtemplate>
    <asp :Label ID=“Label1&#8243; runat=“server”
      Text=‘<%# Eval("CreationDate", "{0:dd-M-yyyy}") %>‘>
    </asp>
   </edititemtemplate>
   <itemtemplate>
    <asp :Label ID="Label1" runat="server"
      Text=’<%# Bind(“CreationDate”, “{0:dd-M-yyyy}”) %>‘>
    </asp>
   </itemtemplate>
  </asp>

Hope that helps,

Regards,
Max.
0
 

Author Comment

by:CoreSupport
ID: 17016551
Hey
havent done that before...
Can I call a method in the asp then and just work out what the month is based on the month id?
Cheer
d
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 17016723
You could do that..

Regards,
Max.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 17016858
Glad to have been helpfull.

Regards,
Max.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now