473,414 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Formating a date field in ASP .Net 2.0 detailview

Okay, I am using a detail view to display some data. Two of the fields are
date fields. I can't seem to get them to display properly. I have tried a
variety of options in the DataFormatString property for the columns in
question, but nothing is working. Is there a particular trick to this?
Mar 29 '06 #1
2 2047
"When the HtmlEncode property is true, the value of the field is HTML encoded
to its string representation before the formatting string is applied. For
some objects, such as dates, you might want to control how the object is
displayed with a formatting string. In those cases, you must set the
HtmlEncode property to false."

http://msdn2.microsoft.com/en-us/lib...ng(VS.80).aspx

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"John Bailey" wrote:
Okay, I am using a detail view to display some data. Two of the fields are
date fields. I can't seem to get them to display properly. I have tried a
variety of options in the DataFormatString property for the columns in
question, but nothing is working. Is there a particular trick to this?

Mar 29 '06 #2
If you are using an SQL data source you can also control how the data is
formatted using the CAST and CONVERT funtions in the query it's self so no
formatting is required in the control.

"Phillip Williams" wrote:
"When the HtmlEncode property is true, the value of the field is HTML encoded
to its string representation before the formatting string is applied. For
some objects, such as dates, you might want to control how the object is
displayed with a formatting string. In those cases, you must set the
HtmlEncode property to false."

http://msdn2.microsoft.com/en-us/lib...ng(VS.80).aspx

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"John Bailey" wrote:
Okay, I am using a detail view to display some data. Two of the fields are
date fields. I can't seem to get them to display properly. I have tried a
variety of options in the DataFormatString property for the columns in
question, but nothing is working. Is there a particular trick to this?

Mar 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Liz Malcolm | last post by:
Hello and TIA. I have a DE form with an option group that if daily is selected todays date is used for start and end date, if weekly is selected Monday - Friday is used. I am trying to add a...
4
by: S. van Beek | last post by:
Dear reader, By a Date field with Now() as default value the content of the field is date plus time. As I need a filter in a query on date only (excluding time) I invented the following...
1
by: Graham Feeley | last post by:
I have a date field named rcdate it is a general date eg: 12/08/2006 3:30:00 PM 12/08/2006 3:00:00 PM I used to update another empty field named rdate with the with using in a update query "...
3
by: Pavkovich | last post by:
I have tried to set a date field when I put a checkmark in a yes/no field. In the date fields control source I put the following: IIf(=0," ",Date()) Unfortunately using Date() simply changes the...
4
by: andrewbda | last post by:
I have tickbox on a form, and I would like to use a date field as the control source. i.e. I would like to have it display as ticked when a date exists in the field, and vice versa. Also,...
2
by: Luqman | last post by:
Hi, Any Idea how to Display Todays Date in DetailView Template Field while Inserting ? For example: When I click on New Button of DetailView Control, I need to display Today's Date in a...
3
by: Finn Stampe Mikkelsen | last post by:
Hi I have defined a table in my database, with 2 date-fields. I have set a default value to DBNull. I have integrated a nullable datetimepicker control to my project and set the apropriate...
2
by: jacc14 | last post by:
Hi Hope there is someone out there that can help. I am sure this is an easy one although not easy to explain. I have a form which produces a report using a query. On the form I have a start and...
7
by: sheri | last post by:
I have a field called date, the date is in the field like this 70925 (which means Sept. 25, 2007). I have another field called day, it is a text field. How do I write a query to populate the day...
10
by: Jes | last post by:
Dear all I have a date field on a HTML form where the user is asked to key in dd/mm/yyyy However, when that is written to MySql it is either not accepted or another value is tored in the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.