problem with date conversion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob

    #1

    problem with date conversion

    Hi,

    i want to pass the date/time from one page to another page like this:

    firts page:
    ---------
    <asp:HyperLin k ID="HyperLink1 " NavigateUrl="my page.aspx?dat= & 'date.now'"
    runat="server"> lijst</asp:HyperLink>

    the code-behind of mypage.aspx
    ---------------------------------
    Dim dd As Date
    dd = Date.Parse(Requ est.QueryString ("dat"))

    this gives the error: String was not recognized as a valid DateTime

    Thanks for help
    Bob


  • Andrew Morton

    #2
    Re: problem with date conversion

    Bob wrote:
    i want to pass the date/time from one page to another page like this:
    >
    firts page:
    ---------
    <asp:HyperLin k ID="HyperLink1 " NavigateUrl="my page.aspx?dat= &
    'date.now'" runat="server"> lijst</asp:HyperLink>
    >
    the code-behind of mypage.aspx
    ---------------------------------
    Dim dd As Date
    dd = Date.Parse(Requ est.QueryString ("dat"))
    >
    this gives the error: String was not recognized as a valid DateTime
    I suspect your date is getting slashes in it, which in a URL may mess things
    up. Try DateTime.Now.To String("yyyyMMd dTHHmmss").

    Andrew


    Comment

    • Hal Rosser

      #3
      Re: problem with date conversion


      "Bob" <cq@qs.qdqdwrot e in message
      news:%239PU84lO IHA.748@TK2MSFT NGP04.phx.gbl.. .
      Hi,
      >
      i want to pass the date/time from one page to another page like this:
      >
      firts page:
      ---------
      <asp:HyperLin k ID="HyperLink1 " NavigateUrl="my page.aspx?dat= & 'date.now'"
      runat="server"> lijst</asp:HyperLink>
      >
      the code-behind of mypage.aspx
      ---------------------------------
      Dim dd As Date
      dd = Date.Parse(Requ est.QueryString ("dat"))
      >
      this gives the error: String was not recognized as a valid DateTime
      >
      Thanks for help
      Bob
      Why dont you try using a session variable. It lives with the user's session.


      Comment

      Working...