tags:

views:

168

answers:

1

How to encode a datetime in a QueryString and read it in the asp:QueryStringParameter

out: (it's a asp:HyperLink NavigateUrl )

String.Format("~/Reports/Logs/Option_History.aspx?OptionID={0}&time={1}", id, time)

in:

<asp:QueryStringParameter Name="time" QueryStringField="Time" Type="DateTime" ConvertEmptyStringToNull="true" />
+3  A: 

You've answered it yourself, except you're looking for UrlEncode. You also need to confirm what format asp:QueryStringParameter Type="DateTime" accepts, e.g. it may require MM/dd/yyyy HH:mm:ss irrespective of the region settings of the web server, or it could be that it is dependent upon the region settings of the web server, in which case you need an invariant date format like yyyy-MM-dd HH:mm:ss.

Mark Hurd
DavRob60