Re: Date format in repeater control
- From: "zdrakec" <zdrakec@xxxxxxxxx>
- Date: 12 Jul 2005 08:10:59 -0700
Right, that is what I was doing, only I wasn't using the Eval... in
other words, I was trying to do:
IIF(IsDBNull(datavalue),"",Format(datavalue,"MM/dd/yyyy"))
which was failing because the IIF does not behave like
If..AndAlso...End If nor like If...OrElse...End If, and I was treating
it as though it did; so the "false" condition of the IIF was getting
examined, and blowing up for DBNull values.
I changed it to
IIF(IsDBNull(Container.DataItem("DateField")),"",DataBinder.Eval(Container.DataItem,"DateField","{0:MM/dd/yyyy}"))
which works just fine since the DBNull evaluates to an empty string, as
you said.
Thanks!
zdrakec
.
- Follow-Ups:
- Re: Date format in repeater control
- From: Teemu Keiski
- Re: Date format in repeater control
- References:
- Date format in repeater control
- From: zdrakec
- Re: Date format in repeater control
- From: Teemu Keiski
- Date format in repeater control
- Prev by Date: Security Exception on 1&1 with SQL Server
- Next by Date: Hey Teemu
- Previous by thread: Re: Date format in repeater control
- Next by thread: Re: Date format in repeater control
- Index(es):
Relevant Pages
|