473,405 Members | 2,344 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,405 software developers and data experts.

Date formatstring in a gridview

I have a simple gridview control contained in a panel in a web user
control. One of the columns in the gridview is of type SQLDateTime. I
would like to strip off the time portion of the DateTime values. I
tried editing the column and specifying a DataFormatString value of
{0:d}, but it just seems to be ignored.

Can someone please tell me what I may be missing here?

Thanks.
Rich

Jul 6 '06 #1
4 2796
hello Richard

you have to add

htmlencode=false

in the column definition

Jul 6 '06 #2
ReyN wrote:
hello Richard

you have to add

htmlencode=false

in the column definition
Thank you! That was proving to be a difficult little bugger to track
down. Now I'm off to figure out exactly what exactly the htmlencode
controls. :)

Thanks again!
Rich

Jul 6 '06 #3
On 6 Jul 2006 05:49:30 -0700, "Richard Carpenter"
<ru*******@hotmail.comwrote:
>ReyN wrote:
>hello Richard

you have to add

htmlencode=false

in the column definition

Thank you! That was proving to be a difficult little bugger to track
down. Now I'm off to figure out exactly what exactly the htmlencode
controls. :)

Thanks again!
Rich
take a look at this:

http://peterkellner.net/?p=36
Peter Kellner
http://peterkellner.net
Jul 6 '06 #4
PeterKellner wrote:
On 6 Jul 2006 05:49:30 -0700, "Richard Carpenter"
<ru*******@hotmail.comwrote:
ReyN wrote:
hello Richard

you have to add

htmlencode=false

in the column definition
Thank you! That was proving to be a difficult little bugger to track
down. Now I'm off to figure out exactly what exactly the htmlencode
controls. :)

Thanks again!
Rich

take a look at this:

http://peterkellner.net/?p=36
Peter Kellner
http://peterkellner.net
Peter,

That was extremely helpful information - just what I was looking for.
Can you comment on just what kind of danger there might be in
"cross-site scripting attacks and malicious content display" when the
grid is processed on the ASP.Net server? My understanding was that a
mere HTML table is generated and sent to the client in either case.
Where is the opportunity for malicious code to be introduced?

Thanks!
Rich

Jul 6 '06 #5

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

Similar topics

50
by: z. f. | last post by:
HI, i have string in format dd/mm/yyyyy hh:mm:ss and giving this as an input to DateTime.Parse gives a string was not recognized as a valid date time format string error. how do i make the parse...
3
by: Simon Harvey | last post by:
Hi all, I'm having problems getting my date to format. Someone told me that with the GridView, you need to use a TemplateColumn and not a BoundColumn when displaying dates. Given that, can...
2
by: Adam Sandler | last post by:
Hello, In VWD 2005 here. Working with a gridview that has the edit button enabled. One of the columns in the grid is of date type in the database. When then user edits the date, clicks the...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
4
by: Miaaa Mukherjee | last post by:
I m using ASP.NET 2005 with VB,C#. I m using GridView to display the data. My problem is with the database field date. I want to use only the date and the fields are manufacturing date and...
3
by: bbawa1 | last post by:
Hi, I have a table which has a field ItemsReceived of type datetime. I have a grid view which has two columns. In first column i have to show the data from field ItemsReceived and in second...
9
by: Kyote | last post by:
I have a textbox that is databound to a table in an access database. The field only contains month/day/year but my databound textbox is also showing a time. Is there any way to prevent it from...
1
by: Jonathan Wood | last post by:
I have a GridView control that displays the data in a List<object; My GridView contains the following in its definition: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"...
4
by: =?Utf-8?B?ZGNoMw==?= | last post by:
Is there a way to conditionally format a dateTime field to produce on result if the value is 10/31/2008 12:00 AM (user didn't enter a time) and another result if the value is 10/31/2008 5:30 PM...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.