format

Discussion in 'ASP.NET 2.0' started by aleks_kleyn, Mar 15, 2007.

  1. For years I use function format to make sure that date is formated properly. But in asp.net I that it may be cases when format does not work as I expect.
    For instance the code
    dim A as string
    A="1/10/07"
    A=format(A,"d")
    <%=A%>
    may return "d" instead of date
    or code
    dim B as date
    A="1/10/07"
    B=format(A,"d")
    will return error.
    What may be the reason
    Kleyn
     
  2. You can format as follows
    dim A as string
    A='1/10/07'
    String.Format('{0:d}', A)

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     

Share This Page