Results 1 to 4 of 4

Thread: [RESOLVED] Inline TryParse and IIF in C#

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    592

    Resolved [RESOLVED] Inline TryParse and IIF in C#

    How do i set the label's text depending on the data field value. e.g. if it's proper datetime value then display it, otherwise display "unknown". Please notice that it's inline C# code

    Code:
    Text='<%# DateTime.TryParse(Eval("MyDate"), out DateTime.Parse("1/1/1753")) == true ? Eval("MyDate") : "unknown" %>'
    Thanks
    Last edited by selanec; Mar 18th, 2010 at 03:27 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width